java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
来源:互联网 发布:windows串口编程实例 编辑:程序博客网 时间:2024/04/25 06:31
首先看国外解决:
下面是总结的解决方法:
在使用eclipse进行整合springmvc时经常会碰到这样的异常: java.lang.ClassNotFoundException:org.springframework.web.context.ContextLoaderListener
这时里的意思是说找不到jar包,如果使用的是maven管理jar包,会发现jar包明明已经有了,但还是报错;如果mvn package生成一个war包发布到tomcat下面会发现,其实项目是没问题的。
1.出现这个问题的原因有可能的其中一点就是spring的jar包没有被加载,有的时候没有拷spring的jar包会出现这个错误,但是当你拷了以后这个错误并没有消失的时候就说明jar包没有被加载,切记spring的jar包一定要放在工程的lib下这样才能避免这个错误的发生。
2.使用了重复的类库,且版本不一致。导致低版本的被优先使用。比如今天遇到一种情况在tomcat服务器使用了axis2.war包,当启动tomcat的时候,axis2.war包会自动解压,之后再该项目包里有相关的spring包,所以当有另外一个工程要到spring时,就有可能要到axis2的spring包,如果版本不一致就会导致该问题,解决的方法就是让该项目不受axis2项目包的影响。
3.如果不是上面两种原因,那么可以试一下下面的解决方案:
参考自:http://stackoverflow.com/questions/6322711/tomcat-spring-web-class-not-found-exception-org-springframework-web-context
选中Deployment Assembly
添加 Java Build Path Entries
选中Maven Dependencies ->点击finish
重启tomcat服务,就可以了!
- java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener 问题原因。
- 关于java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener错误解决方案
- java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- Java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- 部分和问题
- 大数据时代,为什么使用Spark框架?
- 基于MT7688模块的开发笔记1——关于Ubuntu版本
- flex布局
- FZU2216
- java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- 去掉Scrollview滑动顶部和顶部阴影
- 使用Dockerfile创建支持sshd服务自启动的容器镜像(Ubuntu14.04)
- 有关于缓存的 判断
- Paint及Canvas的简单应用
- ios 打印 结构体
- ajax传输字符串
- ZZULIOJ 1879: 蛤玮买好了礼物【数学】
- Android studio 导入 Eclipse 代码的那些坑