Error configuring application listener of class org.springframework.web.context.ContextLoaderListene

简介: Error configuring application listener of class org.springframework.web.context.ContextLoaderListene

今天敲完ssm框架,启动tomcat时报了这个错误。如图:


SEVERE: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener

java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)

at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:527)

at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:509)

at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:137)

at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4823)

at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5381)

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

at org.apache.catalina.core.ContainerBaseStartChild.call(ContainerBase.java:1559)atorg.apache.catalina.core.ContainerBase


StartChild.call(ContainerBase.java:1549)

at java.util.concurrent.FutureTaskSync.innerRun(FutureTask.java:334)atjava.util.concurrent.FutureTask.run(FutureTask.java:166)atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)atjava.util.concurrent.ThreadPoolExecutor


Worker.run(ThreadPoolExecutor.java:615)


at java.lang.Thread.run(Thread.java:722)


Mar 25, 2017 9:30:56 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class org.springframework.web.util.IntrospectorCleanupListener
java.lang.ClassNotFoundException: org.springframework.web.util.IntrospectorCleanupListener
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
    at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:527)
    at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:509)
    at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:137)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4823)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5381)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:722)
Mar 25, 2017 9:30:56 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Skipped installing application listeners due to previous error(s)
Mar 25, 2017 9:30:56 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
Mar 25, 2017 9:30:56 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/ssm] startup failed due to previous errors
Mar 25, 2017 9:30:56 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Mar 25, 2017 9:30:56 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Mar 25, 2017 9:30:56 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1677 ms


这个错误看上去是找不到jar包引起的,但是检查完jar包的引用之后,发现spring-web的jar包是已经引用了的,如果是这种情况的话,解决方法就是将所引用的所有jar包拷贝一份到发布路径的WEB-INF/lib文件夹下。


注意


需要注意的是,eclipse配置完tomcat之后,如果我们不做修改的话,tomcat默认是发布到.metadata\plugins\目录下的wtpwebapps。这个目录在我们的项目目录下。如果想要更改到tomcat的发布目录下的话,我们可以重新添加一个server,选择tomcat,但是不要add任何项目,然后双击tomcat,在这个界面上进行修改:



修改后如图



总结


jar包找不到有可能是因为发布的时候tomcat没有自动将jar包拷贝过去,此时就需要我们手动拷贝一下。


PS:新方法


最近发现了解决这个问题的新方法,在项目上右击-》properties->Deployment Assembly,接下来如图:



然后下一步下一步直到finish,这样,就可以将maven下的jar包发布到发布文件夹下了。

目录
相关文章
|
6月前
An error happened during template parsing (template: “ServletContext resource [/WEB-INF/templates/in
An error happened during template parsing (template: “ServletContext resource [/WEB-INF/templates/in
|
3月前
【Azure 应用服务】Web App Service 中的 应用程序配置(Application Setting) 怎么获取key vault中的值
【Azure 应用服务】Web App Service 中的 应用程序配置(Application Setting) 怎么获取key vault中的值
|
网络安全
Caused by: org.springframework.web.client.ResourceAccessException: I/O error on POST request for "http://xxxx.svc.cluster.local:8080/xxxx": Connection reset; nested exception is java.net.SocketException: Connection reset 什么原因导致得
Caused by: org.springframework.web.client.ResourceAccessException: I/O error on POST request for "xxxx.svc.cluster.local:8080/xxxx ": Connection reset; nested exception is java.net.SocketException: Connection reset 什么原因导致得
2076 0
|
3月前
|
前端开发 JavaScript
【Azure 环境】前端Web通过Azure AD获取Token时发生跨域问题(CORS Error)
【Azure 环境】前端Web通过Azure AD获取Token时发生跨域问题(CORS Error)
|
5月前
|
安全 前端开发 Java
Java Web项目登录报Session Error
Java Web项目登录报Session Error
40 0
|
5月前
|
XML Java 应用服务中间件
在Web Application中集成CAS登录模块
在Web Application中集成CAS登录模块
41 0
|
6月前
|
JavaScript 前端开发
【Web 前端】 jQuery 里的 ID 选择器和 class 选择器有何不同?
【5月更文挑战第1天】【Web 前端】 jQuery 里的 ID 选择器和 class 选择器有何不同?
|
6月前
|
前端开发 图形学
Could you provide some examples of when Canvas or SVG would be the better choice for a web application?
Could you provide some examples of when Canvas or SVG would be the better choice for a web application
|
应用服务中间件
idea 调试报错 Illegal access: this web application instance has been stopped already.
idea 调试报错 Illegal access: this web application instance has been stopped already.
141 0
|
XML 开发框架 Java
Java Web 项目入门指南(http、Servlet、Request、Response、ServletContext、会话技术[cookie、session]、Filter、Listener)
Java Web 项目入门指南(http、Servlet、Request、Response、ServletContext、会话技术[cookie、session]、Filter、Listener)

热门文章

最新文章