java.lang.NoSuchFieldError的:APPLICATION_CONTEXT_ID

2019-08-06 22:28发布

我上运行我的项目收到此错误,其结果是404大势所趋。 该项目是在Spring框架制成。

我看了很多帖子,发现有任何广口瓶或罐外的混合起来。 下面,我想整理我的罐子。 下面的列表是我在我的构建路径:

antlr-2.7.6.jar  
asm.jar  
asm-attrs.jar  
cglib-2.2.jar  
commons-beanutils-1.7.0.jar  
commons-collections-3.1.jar  
commons-digester-1.8.jar  
commons-email-1.0.jar  
commons-fileupload-1.1.1.jar  
commons-io-1.2.jar  
commons-lang-2.5.jar  
commons-logging-1.1.1.jar  
displaytag-1.0-b3.jar  
dom4j-1.6.1.jar  
ehcache-1.1.jar  
hibernate3.jar  
hibernate-jpa-2.0-api-1.0.0.Final.jar  
hibernate-validator-4.0.2.GA.jar  
hsqldb.jar  
itext-2.1.3.jar  
javassist-3.12.0.GA.jar  
jdom.jar  
jstl-1.2.jar  
jta-1.1.jar  
log4j-1.2.14.jar  
msbase.jar  
mssqlserver4v65.jar  
msutil.jar  
mysql.jar  
mysql-connector-java-5.1.15-bin.jar  
ojdbc14.jar  
persistence-api-1.0.jar  
poi-3.0-alpha2.jar  
servlet-2.3.jar  
slf4j-api-1.6.6.jar  
slf4j-log4j12-1.5.6.jar  
slf4j-simple-1.6.6.jar  
spring-asm-3.0.3.RELEASE.jar  
spring-beans-3.0.3.RELEASE.jar  
spring-context-3.0.3.RELEASE.jar  
spring-core-3.0.3.RELEASE.jar  
spring-expression-3.0.3.RELEASE.jar  
spring-hibernate3-2.0.8.jar  
spring-web-3.0.3.RELEASE.jar  
spring-webmvc-3.0.3.RELEASE.jar  
sqljdbc4.jar  
standard.jar  
tree.jar  
validation-api-1.0.0.GA.jar  
wloracle.jar  
wlsqlserver.jar  

这里有云堆栈跟踪

SEVERE: Error loading WebappClassLoader
  delegate: false
  repositories:
    /WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@ca2dce
org.springframework.web.servlet.DispatcherServlet
java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1360)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1083)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4364)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
    at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
    at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
    at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116)
    at org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:315)
    at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:148)
    at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:420)
    at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483)
    at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1433)
    at org.apache.jasper.compiler.Parser.parse(Parser.java:133)
    at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:216)
    at org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
    at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:153)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:294)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:281)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Unknown Source)

我已经删除了很多罐子,我认为,是重复的。
我的问题是所有这些罐子是否足够精确,还是有重复?
请帮帮忙,这个404是我的命......

Answer 1:

你有很多重复的坛子里出现的:

antlr
jta
mysql-connector
javassist
mssqlserver

我会确保你只需要每一个继续之前,制定出你需要的版本,包括一个。

如果你不知道如何做到这一点,让我们知道您是如何导入您的依赖。

这也将是有益的,看看你所看到的堆栈跟踪和导致错误的简化Spring上下文。


如果你看一下这个问题: JasperException:绝对URI:http://java.sun.com/jsp/jstl/core不能得到解决

你需要确保你有JSTL的正确版本,也许一旦你删除重复的JSTL可以修复这个错误。



Answer 2:

我的猜测是删除的spring.jar和弹簧1.2.6.jar; 他们与春天* 3.0.3.RELEASE.jars冲突

和我的两分钱将与Spring框架的工作时使用maven。



文章来源: java.lang.NoSuchFieldError: APPLICATION_CONTEXT_ID_PREFIX