找不到源.500错误代码

时间:2017-08-30 07:20:20

标签: java eclipse maven servlets servlet-3.0

当我尝试调试某些移交给我的代码时,我遇到了一个问题,当我尝试调试某些源代码时,我找不到。我已经检查了所有的配置源,一切看起来都很好。可以有人解释一下我基本上是这个日志所说的和我错过的。

Aug 30, 2017 3:05:03 PM org.apache.catalina.core.StandardHostValve custom
SEVERE: Exception Processing ErrorPage[errorCode=500, location=/error]
java.lang.ClassCastException: org.springframework.web.context.request.async.WebAsyncManager cannot be cast to org.springframework.web.context.request.async.WebAsyncManager
    at org.springframework.web.context.request.async.WebAsyncUtils.getAsyncManager(WebAsyncUtils.java:47)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:955)
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:863)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:728)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:392)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:311)
    at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:395)
    at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:254)
    at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:349)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:175)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1457)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Unknown Source)

1 个答案:

答案 0 :(得分:0)

这个问题可能至少有3个原因:

1. servlet容器不支持Servlet 2.5。

2.未声明web.xml符合Servlet 2.5或更新版本。

3.Webapp的运行时类路径中充斥着不同servlet容器make / version的servlet容器特定JAR文件,这些文件不支持Servlet 2.5。

要解决它,

1.确保您的servlet容器至少支持Servlet 2.5。这至少是Tomcat 6,Glassfish 2,JBoss AS 4.1等。例如,Tomcat 5.5支持最高的Servlet 2.4。如果您无法升级Tomcat,那么您需要将Spring降级为与Servlet 2.4兼容的版本。

2.确保web.xml的根声明符合Servlet 2.5(或者更新,至少是目标运行时支持的最高值)。有关示例,请参阅我们的servlet维基页面的中间位置。

3.确保您在/ WEB-INF / lib中没有像servlet-api.jar或j2ee.jar这样的servlet容器特定库,更糟糕的是,JRE / lib或JRE / lib /分机。他们不属于那里。这是一个非常常见的初学者错误,试图绕过IDE中的编译错误,另请参阅How do I import the javax.servlet API in my Eclipse project?