2017-08-30 173 views
0

當我嘗試調試交給我的某個代碼並嘗試調試某些源代碼時,我遇到了一個問題。我已經檢查了所有配置源代碼和所有代碼看起來不錯。有人向我解釋基本上這個日誌說什麼和我想念什麼。未找到源代碼.500錯誤代碼

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

看起來像你有一個類加載器問題。你的classpath中有兩次sping-web.jar嗎? – Jens

+0

如何在eclipse中檢查? – art

+0

你在嵌入式tomcat中運行代碼嗎? – Jens

回答

0

這個問題可以具有至少3個原因:

1. servlet容器不支持Servlet 2.5。

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

3. webapp的運行時類路徑充斥着不同Servlet容器特定的servlet容器特定的JAR文件make/version,它不支持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 wiki頁面中途的某處。

3.確保在/ WEB-INF/lib中沒有任何特定於servlet容器的庫,如servlet-api.jar或j2ee.jar,或者更糟糕的是,JRE/lib或JRE/lib/ext 。他們不屬於那裏。這是一個很常見的初學者的錯誤,試圖繞過IDE中的編譯錯誤,另請參閱How do I import the javax.servlet API in my Eclipse project?