java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
来源:互联网 发布:java 腾讯地图api接口 编辑:程序博客网 时间:2024/06/03 17:26
转载连接
在web.xml中配置了spring的上下文监听器:
eclipse中web项目部署到tomcat时出现的错误
- <listener>
- <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
- </listener>
随后启动tomcat服务器,控制台提示如下错误:
- java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
这种错误意思很明确:找不到“ org.springframework.web.context.ContextLoaderListener”这个类,ContextLoaderListener这个类是在spring-web.jar包下,我仔细检查了项目jar环境,发现该jar包确实存在,而且也能找到编译后的ContextLoaderListener.class文件。
- Java虚拟机是根据Java ClassLoader(类加载器)决定如何加载Class。
- 系统默认提供了3个ClassLoader
- Root ClassLoader,ClassPath Loader,Ext ClassLoader
- 我们也可以编写自己的ClassLoader,去加载特定环境下的Jar文件。
- 能不能加载Jar,加载哪里的Jar,是由ClassLoader决定的。
- 楼主的问题可能是 导入的仅仅是jar包的引用,例如在eclipse中通过build path加进user lib……(类似快捷方式)
- 这种在Java Application中没问题,但在web Application中可能会出现找不到类的异常。
- 在WEB Application中jar包最好放在webroot或webcontent下的lib文件夹内,特别是xml中用到的jar包。
因为我是通过eclipse的build path直接引用的jar包,没有把jar文件拷贝到lib目录下。
将所需的jar包全部拷贝到WEB-INF/lib下,再重新启动tomcat便能顺利通过了。
1 0
- 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
- javascript--document对象
- github上星星总数排名(可以看一下源码的哦)
- Linux开启SSH
- Nginx下使Thinkphp URL模式支持PATHINFO和REWRITE
- java发送http的get、post请求
- java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- layout_gravity和gravity区别
- Golang资料集
- ImageLoader用法详解
- Python无法连接mongodb数据库,Connection方法不存在
- 一行代码解决各种IE兼容问题,IE6,IE7,IE8,IE9,IE10
- 最全的Android源码目录结构详解
- TCP的几个状态 (SYN, FIN, ACK, PSH, RST, URG)
- 38页上机练习2