小编典典

java.lang.NoSuchFieldError:APPLICATION_CONTEXT_ID_PREFIX

java

我在运行项目时收到此错误,结果最终是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杀了我…


阅读 403

收藏
2020-11-26

共1个答案

小编典典

那里有很多重复的罐子:

antlr
jta
mysql-connector
javassist
mssqlserver

在继续之前,我将确保您只有一个,确定您需要的版本并包括该版本。

如果您不确定如何执行此操作,请让我们知道您如何导入依赖项。

查看正在查看的堆栈跟踪以及导致错误的简化Spring上下文也将很有帮助。


如果您查看此问题:JasperException:绝对uri:http://java.sun.com/jsp/jstl/core无法解析

您需要确保拥有正确的JSTL版本,也许一旦删除重复的JSTL,它可能会解决该错误。

2020-11-26