日韩久久久精品,亚洲精品久久久久久久久久久,亚洲欧美一区二区三区国产精品 ,一区二区福利

Eclipse報錯:java.lang.ClassNotFoundExceptio

系統 2023 0

Eclipse中tomcat部署工程啟動后報錯:

      嚴重: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1678)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1523)
	at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)
	at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)
	at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4660)
	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)
	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:662)
    

問題背景

工程為maven工程,ContextLoaderListener類位于spring-web-3.1.0.RELEASE.jar包中。檢查了maven的pom.xml,依賴引入正常。在工程Maven Dependencies視圖中也能看到spring-web-3.1.0.RELEASE.jar包被正常引入進來了。

?

錯誤原因:

進入到tomcat的部署路徑.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\下檢查了一下,發現工程部署后在WEB-INF文件夾下沒有生成lib目錄,正常情況下,會生成lib目錄并把工程的所有依賴jar包都部署到該目錄下。

?

解決方案:

1.右鍵點擊項目--選擇Properties

選擇Deployment Assembly,在右邊點擊Add按鈕,在彈出的窗口中選擇Java Build Path Entries。如下圖所示:

Eclipse報錯:java.lang.ClassNotFoundException: ContextLoaderListener

2.點擊Next,選擇Maven Dependencies

Eclipse報錯:java.lang.ClassNotFoundException: ContextLoaderListener

3.點擊Finish,然后可以看到已經把Maven Dependencies添加到Web應用結構中了

Eclipse報錯:java.lang.ClassNotFoundException: ContextLoaderListener

?

操作完后,重新部署工程,不再報錯了。然后我們再到.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\目錄下,發現工程WEB-INF目錄下自動生成了lib目錄,并且所有的依賴jar包也都已經部署進來。問題因此解決。

Eclipse報錯:java.lang.ClassNotFoundException: ContextLoaderListener


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 镇巴县| 中牟县| 福建省| 长海县| 通渭县| 莎车县| 房产| 紫云| 榕江县| 河源市| 台州市| 鹤岗市| 平塘县| 宾川县| 安阳市| 景谷| 常宁市| 康保县| 武冈市| 荔波县| 花莲县| 泌阳县| 乌恰县| 唐山市| 星子县| 德格县| 聂拉木县| 醴陵市| 曲靖市| 定西市| 育儿| 甘洛县| 汝城县| 句容市| 锡林郭勒盟| 盈江县| 黄山市| 明水县| 大名县| 永和县| 通渭县|