萬惡的 one or more listeners failed to start 和 Servlet.init() for servlet [dispatcherServlet] threw exception


maven+ssm項目啟動報錯:

org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [org.springframework.web.context.ContextLoaderListener]
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [X:\IDEAWorkspace\easyPartTimeJob\target\easyPartTimeJob-1.0-SNAPSHOT\WEB-INF\classes\com\fireDragon\bo\AccountInfoBO.class]; nested exception is org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet: file [X:\IDEAWorkspace\easyPartTimeJob\target\easyPartTimeJob-1.0-SNAPSHOT\WEB-INF\classes\com\fireDragon\bo\AccountInfoBO.class]; nested exception is java.lang.IllegalArgumentException

日志很詳細,但是我找了很久都找不出原因(看不懂)。百度上的博客看了個遍。然后我對着一個網上的ssm整合教程重新寫了一個整合demo,這個可以啟動了,於是我得到了一個可以跑起來的項目。

我對照各個層次的代碼發現沒錯后,對比pom文件,使用控制變量法一個一個排除(哭卿卿),發現了罪魁禍首:一個jar包:(刪除這個東西即可啟動項目),原因是jar包沖突了,ORZ。

然后訪問一個我寫的測試接口,發現報了一個新的錯誤:

 

我的是Spring版本問題,由5.0.8換為4.3.9即可(大俠隨機應變)。解決這兩個問題后,我的demo就可以跑通各層了。

建議:如果整合時確保代碼無誤,可以往spring版本及jar包沖突方面考慮!這種錯誤有可能人人不一樣,但是我找個BUG找了三天,覺得還是有必要記錄一下(doge)


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



猜您在找 javax.servlet.ServletException: Servlet.init() for servlet springmvc threw exception docker安裝部署web項目 一直報錯javax.servlet.ServletException: Servlet.init() for servlet [dispatcher] threw exception 關於springmvc的context:component-scan 標簽使用時HTTP Status 500 - Servlet.init() for servlet springmvc threw exception的問題 遇到“org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start.”怎么辦 Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause ------>Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause 錯誤:Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] 啟動tomcat報錯One or more listeners failed to start,卻找不到任何錯誤日志的臨時解決方案 Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause java.lang.Nul 關於Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause錯誤提示
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM