maven ClassNotFoundException: ContextLoaderListener
2017-04-06 11:16
183 查看
今天整合SpringMVC与MyBatis,项目是通过Maven搭建的,在run as on server时,出现ClassNotFoundException异常:
![](https://img-blog.csdn.net/20170406105756571?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWVsZW5wZW5n/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
然后在网上查找得知是由于eclipse发布web项目时,没有将jar包发布,即:lib目录不存在
![](https://img-blog.csdn.net/20170406110313057?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWVsZW5wZW5n/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
解决办法:
设置一下eclipse:
项目 —> properties -> Deployment Assembly -> Add -> Java Build Path Entries -> 选择Maven Dependencies -> Finish -> OK
把对应的Maven依赖包也发布到tomcat,调试时会自动把那些jar发布到指定目录下,tomcat也能找到那些jar了。
![](https://img-blog.csdn.net/20170406111313110?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWVsZW5wZW5n/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
Unluckily,又出现Exception:
![](https://img-blog.csdn.net/20170406111327797?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWVsZW5wZW5n/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
解决办法:重新指定Maven的本地仓库
原因:可能是本地仓库中的某些jar包出错了….2333333333333
http://stackoverflow.com/questions/6322711/tomcat-spring-web-class-not-found-exception-org-springframework-web-context
http://stackoverflow.com/questions/32229137/updating-status-for-apache-tomcat-v7-0-at-localhost-java-lang-indexoutofbo
然后在网上查找得知是由于eclipse发布web项目时,没有将jar包发布,即:lib目录不存在
解决办法:
设置一下eclipse:
项目 —> properties -> Deployment Assembly -> Add -> Java Build Path Entries -> 选择Maven Dependencies -> Finish -> OK
把对应的Maven依赖包也发布到tomcat,调试时会自动把那些jar发布到指定目录下,tomcat也能找到那些jar了。
Unluckily,又出现Exception:
解决办法:重新指定Maven的本地仓库
原因:可能是本地仓库中的某些jar包出错了….2333333333333
参考链接
http://www.cnblogs.com/amosli/p/4067665.htmlhttp://stackoverflow.com/questions/6322711/tomcat-spring-web-class-not-found-exception-org-springframework-web-context
http://stackoverflow.com/questions/32229137/updating-status-for-apache-tomcat-v7-0-at-localhost-java-lang-indexoutofbo
相关文章推荐
- 启动maven项目报错:java.lang.ClassNotFoundException: ContextLoaderListener解决方法
- Eclipse报错:java.lang.ClassNotFoundException: ContextLoaderListener(Maven工程)
- maven项目 启动报错:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- maven项目 启动报错:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- maven 项目出现 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- SSH+ maven整合:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- maven 项目出现 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- maven 项目出现 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- maven 项目出现 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- maven java.lang.ClassNotFoundException: ContextLoaderListener
- maven 项目出现 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- maven项目 启动报错:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- maven项目 启动报错:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- maven 项目出现 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- maven项目报java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- maven 项目出现 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- Maven java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- maven项目 启动报错:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- maven项目 启动报错:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- maven项目 启动报错:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener