【web.xml】报错java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener-阿里云开发者社区

开发者社区> angel挤一挤> 正文

【web.xml】报错java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

简介: 今天搭建新的项目,虽然在web.xml中配置了ContextLoaderListener以及IntrospectorCleanupListener 如下: web.xml中部分代码: 1 2 3 org.
+关注继续查看

今天搭建新的项目,虽然在web.xml中配置了ContextLoaderListener以及IntrospectorCleanupListener

如下:

web.xml中部分代码:

 1 <!-- 监听servletContext,启动contextConfigLocation中的spring配置信息 -->
 2     <listener>
 3         <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
 4     </listener>
 5 
 6 
 7     <!-- 防止spring内存溢出监听器   可用可不用-->
 8     <listener>
 9         <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
10     </listener>
View Code

但是,在项目启动的时候,依旧报错:

 1 严重: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
 2 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
 3     at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1285)
 4     at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
 5     at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:511)
 6     at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:492)
 7     at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
 8     at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4676)
 9     at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5216)
10     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
11     at org.apache.catalina.startup.HostConfig.reload(HostConfig.java:1386)
12     at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1350)
13     at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1586)
14     at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:280)
15     at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
16     at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1164)
17     at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1388)
18     at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1392)
19     at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1360)
20     at java.lang.Thread.run(Unknown Source)
21 五月 15, 2017 8:44:23 下午 org.apache.catalina.core.StandardContext listenerStart
22 严重: Error configuring application listener of class org.springframework.web.util.IntrospectorCleanupListener
23 java.lang.ClassNotFoundException: org.springframework.web.util.IntrospectorCleanupListener
24     at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1285)
25     at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
26     at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:511)
27     at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:492)
28     at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
29     at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4676)
30     at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5216)
31     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
32     at org.apache.catalina.startup.HostConfig.reload(HostConfig.java:1386)
33     at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1350)
34     at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1586)
35     at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:280)
36     at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
37     at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1164)
38     at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1388)
39     at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1392)
40     at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1360)
41     at java.lang.Thread.run(Unknown Source)
View Code

 

解决方法:

项目上,右键 properties,选择进入Deployment Assembly,

然后将Maven库的架包 也选择部署,这样项目就能读取到相关的架包,就可以正常启动而不会因为找不到   某些类         

 

 

 

 

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
tomcat启动报错org.apache.catalina.core.StandardContext listenerStart
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/bitree1/article/details/72236633 tomcat启动报错: org.
3889 0
【SpringMVC】SpringMVC配置拦截器 mvc:exclude-mapping 报错
转载请注明出处:http://blog.csdn.net/qq_26525215 本文源自【大学之旅_谙忆的博客】 今天写SpringMVC的拦截器的时候,遇到这样一个错误, Element mvc:exclude-mapping is not allowed here. 经过一番搜索,找到了原因。
1729 0
【hibernate 报错】No serializer found for class org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer 【get和load的区别】
报错: 1 HTTP Status 500 - Could not write content: No serializer found for class org.hibernate.proxy.
1035 0
spring使用中报Cannot proxy target class because CGLIB2 is not available错
发现问题 public interface StudentService {  void add(); } @Service public class StudentServiceImpl implements StudentService {  void add(){  } } public class StudentAction extends ActionSupp
1059 0
hexo g报错 用的next主题 ERROR Script load failed: themes/hexo-theme-next/scripts/tags/exturl.js
ERROR Script load failed: themes/hexo-theme-next/scripts/tags/exturl.js Error: Cannot find module 'hexo-util' at Function.Module._resolveFilename (module.js:336:15) at Function.Module._loa
3429 0
Hibernate中HQL语句查询指定字段值报错:ClassCastException: [java.lang.Object; cannot be cast to bean.PersonStatic
在有一次通过如下HQL语句进行查找相应字段时: String hql = "select sum(search),sum(geometry),sum(greedy), sum(graph),sum(number),sum(simulate),sum(combine),sum(structure) from PersonStatis ps where ps.
943 0
itext生成PDF文件报错“Font 'STSong-Light' with 'UniGB-UCS2-H' is not recognized.”
最近需要写一个抽取表结构的工具,类似于powerdesigner中的表图,其中有一步用到了itext这个第三方jar包来生成pdf文件,碰到了一个问题,记录于此。
1906 0
+关注
angel挤一挤
【任何0基础都能看懂的步骤和解决方法!】
340
文章
0
问答
文章排行榜
最热
最新
相关电子书
更多
《2021云上架构与运维峰会演讲合集》
立即下载
《零基础CSS入门教程》
立即下载
《零基础HTML入门教程》
立即下载