您的位置:首页 > 运维架构 > Tomcat

【项目启动】 tomcat启动,项目无法启动,无法正常访问/项目可以启动,报错:java.lang.ClassNotFoundException: ContextLoaderListener

2016-06-23 16:13 916 查看
使用maven搭建项目(这个错误和是不是使用maven搭建项目没有关系),然后部署到tomcat中运行。

出现问题1:

tomcat跑起来了,但是启动时间很短,没有报错,项目不能正常访问

项目启动时间很短,并且没有报错

<!-- 监听servletContext,启动contextConfigLocation中的spring配置信息 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<!-- 防止spring内存溢出监听器   可用可不用-->
<listener>
<listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
</listener>


View Code

发现问题的过程:

但是我们在maven的pom.xml中已经将它所依赖的架包全都导入了。

工程为maven工程,ContextLoaderListener类位于spring-web-3.1.0.RELEASE.jar包中。检查了maven的pom.xml,依赖引入正常。在工程Maven Dependencies视图中也能看到spring-web-3.1.0.RELEASE.jar包被正常引入进来了。

解决途径:

所以,应该是项目中所依赖的架包什么的都没有被正常的打包部署到tomcat下







添加后,重新clean一下项目,然后启动起来项目正常启动!!!!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: