Tomcat7启动报NoClassDefFoundError,Jetty启动正常

问题描述

今天使用Maven做了个Struts2+Spring3+Hibernate4的小Demo,使用Tomcat7启动时报错,错误信息如下: 2013-12-2 13:53:49 org.apache.catalina.core.AprLifecycleListener init信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:jdk1.6bin;.;C:WINDOWSSunJavabin;C:WINDOWSsystem32;C:WINDOWS;D:/Java/jdk/bin/../jre/bin/client;D:/Java/jdk/bin/../jre/bin;D:/Java/jdk/bin/../jre/lib/i386;D:Javajdkbin;D:oracleapporacleproduct10.2.0serverbin;C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C:Program FilesCommon FilesThunder NetworkKanKanCodecs;D:svnbin;D:rosecommon;D:mysqlbasebin;D:WPSWPSOffice9.1.0.4249office6;C:Program FilesStormIICodec;C:Program FilesStormII;D:Javajdkbin;D:maven3bin;D:antbin;D:btracebin;;D:epseclipse1.0.3;2013-12-2 13:53:50 org.apache.tomcat.util.digester.SetPropertiesRule begin警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:ssh_easyui_st' did not find a matching property.2013-12-2 13:53:52 org.apache.coyote.AbstractProtocol init信息: Initializing ProtocolHandler ["http-bio-8486"]2013-12-2 13:53:52 org.apache.coyote.AbstractProtocol init信息: Initializing ProtocolHandler ["ajp-bio-8219"]2013-12-2 13:53:52 org.apache.catalina.startup.Catalina load信息: Initialization processed in 3256 ms2013-12-2 13:53:52 org.apache.catalina.core.StandardService startInternal信息: Starting service Catalina2013-12-2 13:53:52 org.apache.catalina.core.StandardEngine startInternal信息: Starting Servlet Engine: Apache Tomcat/7.0.472013-12-2 13:53:53 org.apache.tomcat.websocket.server.WsSci onStartup信息: JSR 356 WebSocket (Java WebSocket 1.0) support is not available when running on Java 6. To suppress this message, run Tomcat on Java 7, remove the WebSocket JARs from $CATALINA_HOME/lib or add the WebSocketJARs to the tomcat.util.scan.DefaultJarScanner.jarsToSkip property in $CATALINA_BASE/conf/catalina.properties. Note that the deprecated Tomcat 7 WebSocket API will be available. 2013-12-2 13:53:53 org.apache.catalina.util.SessionIdGenerator createSecureRandom信息: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [234] milliseconds.2013-12-2 13:53:54 org.apache.catalina.core.ContainerBase startInternal严重: A child container failed during startjava.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/ssh_easyui]]at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)at java.util.concurrent.FutureTask.get(FutureTask.java:83)at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:800)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:303)at java.util.concurrent.FutureTask.run(FutureTask.java:138)at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)at java.lang.Thread.run(Thread.java:619)Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/ssh_easyui]]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)... 7 moreCaused by: java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContextat java.lang.Class.getDeclaredFields0(Native Method)at java.lang.Class.privateGetDeclaredFields(Class.java:2291)at java.lang.Class.getDeclaredFields(Class.java:1743)at org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:106)at org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:263)at org.apache.catalina.startup.WebAnnotationSet.loadApplicationListenerAnnotations(WebAnnotationSet.java:92)at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:65)at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:405)at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:881)at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:376)at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5322)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)... 7 moreCaused by: java.lang.ClassNotFoundException: org.springframework.context.ApplicationContextat org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702)at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)... 21 more2013-12-2 13:53:54 org.apache.catalina.core.ContainerBase startInternal严重: A child container failed during startjava.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)at java.util.concurrent.FutureTask.get(FutureTask.java:83)at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:302)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:732)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)at org.apache.catalina.startup.Catalina.start(Catalina.java:691)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)at java.lang.reflect.Method.invoke(Method.java:597)at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:456)Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)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:303)at java.util.concurrent.FutureTask.run(FutureTask.java:138)at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)at java.lang.Thread.run(Thread.java:619)Caused by: org.apache.catalina.LifecycleException: A child container failed during startat org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:800)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)... 7 more2013-12-2 13:53:54 org.apache.catalina.startup.Catalina start严重: The required Server component failed to start so Tomcat is unable to start.org.apache.catalina.LifecycleException: Failed to start component [StandardServer[8325]]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)at org.apache.catalina.startup.Catalina.start(Catalina.java:691)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)at java.lang.reflect.Method.invoke(Method.java:597)at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:456)Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Catalina]]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:732)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)... 7 moreCaused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina]]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)... 9 moreCaused by: org.apache.catalina.LifecycleException: A child container failed during startat org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:302)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)... 11 more2013-12-2 13:53:54 org.apache.coyote.AbstractProtocol pause信息: Pausing ProtocolHandler ["http-bio-8486"]2013-12-2 13:53:54 org.apache.coyote.AbstractProtocol pause信息: Pausing ProtocolHandler ["ajp-bio-8219"]2013-12-2 13:53:54 org.apache.catalina.core.StandardService stopInternal信息: Stopping service Catalina2013-12-2 13:53:54 org.apache.coyote.AbstractProtocol destroy信息: Destroying ProtocolHandler ["http-bio-8486"]2013-12-2 13:53:54 org.apache.coyote.AbstractProtocol destroy信息: Destroying ProtocolHandler ["ajp-bio-8219"]    spring-context-3.1.2.RELEASE.jar这个包在maven中引入了,lib下可以看到,把target的classes文件删除重新编译或者换个tomcat[Tomcat_7039,Tomcat_7047]还是报错,很奇怪。使用jetty启动时成功,页面可以访问没问题,以前也遇到过tomcat启动报A child container failed during start错,但那是少包引起的,现在情况是包存在启动却报错,请教这是什么原因引起的?

解决方案

是不是jar包冲突,看下WEN-INF/lib报下是否存在不同版本spring-context
解决方案二:
应该是在不同的jar中,存在相同的包路径,但是在其中的一个路径中不存在指定的那个类。

时间: 2024-09-18 02:03:01

Tomcat7启动报NoClassDefFoundError,Jetty启动正常的相关文章

tomcat启动报错-Tomcat 启动报错 好像说mysql连接数超了 求帮助

问题描述 Tomcat 启动报错 好像说mysql连接数超了 求帮助 014-06-12 10:37:06500 ERROR [com.neusoft.common.CommonDao] - 公共模块-初始化字典表失败 org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications link failure due to underlying exception

tomcat启动报错-eclipse 启动 tomcat 异常

问题描述 eclipse 启动 tomcat 异常 tomcat: apache-tomcat-7.0.54-windows-x86 绿色版 eclipse: eclipse-jee-luna-R-win32 . eclipse-jee-indigo-SR2-win32 直接在 ${TOMCAT_HOME}/bin 下双击 startup.bat 可以正常启动,无任何问题, 但是在 eclipse 中配置好之后,加入web工程,启动tomcat,就出现了下面的错误信息: Error occurr

tomcat启动报错-tomcat启动时一闪而过

问题描述 tomcat启动时一闪而过 启动日志 catalina.logINFO: Initializing ProtocolHandler [""ajp-bio-8009""]九月 17 2013 10:30:54 上午 org.apache.coyote.AbstractProtocolHandler initSEVERE: Failed to initialize end point associated with ProtocolHandler ["

tomcat启动报错这个怎么解决?

问题描述 tomcat启动报错这个怎么解决? 解决方案 tomcat(错误一) 解决启动报错问题一tomcat启动报错tomcat启动报错原因分析及解决 解决方案二: 配置有误?可以重新启动或重新部署tomcat 解决方案三: 换个绿色版的tomcat,重新部署下.

heartbeat+drbd实现双机备份,drbd启动报错

问题描述 heartbeat+drbd实现双机备份,drbd启动报错 drbd启动报错: 主机: [root@bjfu1 drbd.d]# service drbd start Starting DRBD resources: [ create res: r1 prepare disk: r1 adjust disk: r1:failed(apply-al:255) adjust net: r1 ] .......... DRBD's startup script waits for the p

jboss启动报错,求救,谢谢

问题描述 jboss启动报错,求救,谢谢 WARNING: -logmodule is deprecated. Please use the system property 'java.util.logging.manager' or the 'java.util.logging.LogManager' service loader.11:28:14865 INFO [org.jboss.modules] JBoss Modules version 1.1.1.GA11:28:15021 INF

急 weblogic 10.3.6.0启动报错

问题描述 急 weblogic 10.3.6.0启动报错 TOMCAT 运行正常 WEBLOGIC 启动就报错 下面是错误信息: weblogic.application.ModuleException: [HTTP:101216]Servlet: "spring" failed to preload on startup in Web application: "kbyxbj_mvc". org.springframework.beans.factory.Bean

spring mvc-springmvc项目启动报错

问题描述 springmvc项目启动报错 报错如上 我按照网上的方法清空了 好多缓存文件之列的 但是没有用啊!! 上图自动咋生成了 spring_mvc.xml文件呢? 有没有知道的大神!!! 解决方案 后来重新试了一下 原来是 Dynastic web project 的名称命名问题 项目发布到tomcat上后 在 config/Catalina/localhost/目录下会生成和 项目名称一样的xml文件哦 错就错在我之前 给springMVC项目起名字的时候 写成了 spring MVC

javaee-weblogic启动报错,求高手解答!!

问题描述 weblogic启动报错,求高手解答!! product spec-version:null]: The encoding jsp-descriptor param has been deprecated. Consider declaring the encoding in th e jsp-config element (web.xml) or as a page directive (pageEncoding) instead.> java.lang.ExceptionInIni