转自:https://yq.aliyun.com/ziliao/597445
Eclipse中tomcat部署工程启动后报错:
二月 25, 2016 2:34:00 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:cloud2' did not find a matching property.
二月 25, 2016 2:34:00 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server version: Apache Tomcat/7.0.68
二月 25, 2016 2:34:00 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server built: Feb 8 2016 20:25:54 UTC
二月 25, 2016 2:34:00 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server number: 7.0.68.0
二月 25, 2016 2:34:00 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Name: Windows 7
二月 25, 2016 2:34:00 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Version: 6.1
二月 25, 2016 2:34:00 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Architecture: amd64
二月 25, 2016 2:34:00 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Java Home: E:\jdk\Java\jdk1.7.0_79\jre
二月 25, 2016 2:34:00 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Version: 1.7.0_79-b15
二月 25, 2016 2:34:00 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Vendor: Oracle Corporation
二月 25, 2016 2:34:00 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_BASE: E:\changchengworkspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
二月 25, 2016 2:34:00 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_HOME: E:\tomcat\apache-tomcat-7.0.68
二月 25, 2016 2:34:00 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.base=E:\changchengworkspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
二月 25, 2016 2:34:00 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.home=E:\tomcat\apache-tomcat-7.0.68
二月 25, 2016 2:34:00 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dwtp.deploy=E:\changchengworkspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
二月 25, 2016 2:34:00 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.endorsed.dirs=E:\tomcat\apache-tomcat-7.0.68\endorsed
二月 25, 2016 2:34:00 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dfile.encoding=GBK
二月 25, 2016 2:34:00 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: Loaded APR based Apache Tomcat Native library 1.1.33 using APR version 1.5.1.
二月 25, 2016 2:34:00 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
二月 25, 2016 2:34:01 下午 org.apache.catalina.core.AprLifecycleListener initializeSSL
信息: OpenSSL successfully initialized (OpenSSL 1.0.1m 19 Mar 2015)
二月 25, 2016 2:34:01 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-apr-8080"]
二月 25, 2016 2:34:01 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-apr-8009"]
二月 25, 2016 2:34:01 下午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 835 ms
二月 25, 2016 2:34:01 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
二月 25, 2016 2:34:01 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.68
二月 25, 2016 2:34:01 下午 org.apache.catalina.core.StandardContext listenerStart
严重: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1858)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1701)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:504)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:486)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:113)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4984)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5584)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1572)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1562)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
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:745)
二月 25, 2016 2:34:01 下午 org.apache.catalina.core.StandardContext listenerStart
严重: Error configuring application listener of class org.springframework.web.util.IntrospectorCleanupListener
java.lang.ClassNotFoundException: org.springframework.web.util.IntrospectorCleanupListener
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1858)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1701)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:504)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:486)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:113)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4984)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5584)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1572)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1562)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
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:745)
二月 25, 2016 2:34:01 下午 org.apache.catalina.core.StandardContext listenerStart
严重: Error configuring application listener of class org.springframework.web.util.Log4jConfigListener
java.lang.ClassNotFoundException: org.springframework.web.util.Log4jConfigListener
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1858)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1701)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:504)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:486)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:113)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4984)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5584)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1572)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1562)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
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:745)
二月 25, 2016 2:34:01 下午 org.apache.catalina.core.StandardContext listenerStart
严重: Skipped installing application listeners due to previous error(s)
二月 25, 2016 2:34:01 下午 org.apache.catalina.core.StandardContext startInternal
严重: One or more listeners failed to start. Full details will be found in the appropriate container log file
二月 25, 2016 2:34:01 下午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/cloud2] startup failed due to previous errors
二月 25, 2016 2:34:01 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-apr-8080"]
二月 25, 2016 2:34:01 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-apr-8009"]
二月 25, 2016 2:34:01 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 406 ms
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:cloud2' did not find a matching property.
二月 25, 2016 2:34:00 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server version: Apache Tomcat/7.0.68
二月 25, 2016 2:34:00 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server built: Feb 8 2016 20:25:54 UTC
二月 25, 2016 2:34:00 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server number: 7.0.68.0
二月 25, 2016 2:34:00 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Name: Windows 7
二月 25, 2016 2:34:00 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Version: 6.1
二月 25, 2016 2:34:00 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Architecture: amd64
二月 25, 2016 2:34:00 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Java Home: E:\jdk\Java\jdk1.7.0_79\jre
二月 25, 2016 2:34:00 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Version: 1.7.0_79-b15
二月 25, 2016 2:34:00 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Vendor: Oracle Corporation
二月 25, 2016 2:34:00 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_BASE: E:\changchengworkspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
二月 25, 2016 2:34:00 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_HOME: E:\tomcat\apache-tomcat-7.0.68
二月 25, 2016 2:34:00 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.base=E:\changchengworkspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
二月 25, 2016 2:34:00 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.home=E:\tomcat\apache-tomcat-7.0.68
二月 25, 2016 2:34:00 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dwtp.deploy=E:\changchengworkspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
二月 25, 2016 2:34:00 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.endorsed.dirs=E:\tomcat\apache-tomcat-7.0.68\endorsed
二月 25, 2016 2:34:00 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dfile.encoding=GBK
二月 25, 2016 2:34:00 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: Loaded APR based Apache Tomcat Native library 1.1.33 using APR version 1.5.1.
二月 25, 2016 2:34:00 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
二月 25, 2016 2:34:01 下午 org.apache.catalina.core.AprLifecycleListener initializeSSL
信息: OpenSSL successfully initialized (OpenSSL 1.0.1m 19 Mar 2015)
二月 25, 2016 2:34:01 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-apr-8080"]
二月 25, 2016 2:34:01 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-apr-8009"]
二月 25, 2016 2:34:01 下午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 835 ms
二月 25, 2016 2:34:01 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
二月 25, 2016 2:34:01 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.68
二月 25, 2016 2:34:01 下午 org.apache.catalina.core.StandardContext listenerStart
严重: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1858)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1701)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:504)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:486)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:113)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4984)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5584)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1572)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1562)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
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:745)
二月 25, 2016 2:34:01 下午 org.apache.catalina.core.StandardContext listenerStart
严重: Error configuring application listener of class org.springframework.web.util.IntrospectorCleanupListener
java.lang.ClassNotFoundException: org.springframework.web.util.IntrospectorCleanupListener
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1858)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1701)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:504)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:486)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:113)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4984)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5584)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1572)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1562)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
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:745)
二月 25, 2016 2:34:01 下午 org.apache.catalina.core.StandardContext listenerStart
严重: Error configuring application listener of class org.springframework.web.util.Log4jConfigListener
java.lang.ClassNotFoundException: org.springframework.web.util.Log4jConfigListener
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1858)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1701)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:504)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:486)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:113)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4984)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5584)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1572)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1562)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
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:745)
二月 25, 2016 2:34:01 下午 org.apache.catalina.core.StandardContext listenerStart
严重: Skipped installing application listeners due to previous error(s)
二月 25, 2016 2:34:01 下午 org.apache.catalina.core.StandardContext startInternal
严重: One or more listeners failed to start. Full details will be found in the appropriate container log file
二月 25, 2016 2:34:01 下午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/cloud2] startup failed due to previous errors
二月 25, 2016 2:34:01 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-apr-8080"]
二月 25, 2016 2:34:01 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-apr-8009"]
二月 25, 2016 2:34:01 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 406 ms
问题背景:
工程为maven工程,ContextLoaderListener类位于spring-web-3.1.0.RELEASE.jar包中。检查了 maven的pom.xml,依赖引入正常。在工程Maven Dependencies视图中也能看到spring-web-3.1.0.RELEASE.jar包被正常引入进来了。
错误原因:
进入到tomcat的部署路径.metadata\.plugins\org.eclipse.wst.server.core\tmp0 \wtpwebapps\下检查了一下,发现工程部署后在WEB-INF文件夹下没有生成lib目录,正常情况下,会生成lib目录并把工程的所有依赖 jar包都部署到该目录下。
解决方案:
1.右键点击项目--选择Properties
选择Deployment Assembly,在右边点击Add按钮,在弹出的窗口中选择Java Build Path Entries。如下图所示:
2.点击Next,选择Maven Dependencies
3.点击Finish,然后可以看到已经把Maven Dependencies添加到Web应用结构中了
操作完后,重新部署工程,不再报错了。然后我们再到.metadata\.plugins \org.eclipse.wst.server.core\tmp0\wtpwebapps\目录下,发现工程WEB-INF目录下自动生成了lib目 录,并且所有的依赖jar包也都已经部署进来。问题因此解决。