ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to

项目中使用hibernate和spring,原来使用的tomcat版本是6,后来把tomcat换成了apache-tomcat-7.0.30-windows-x64,spring的版本是:3.1

结果启动tomcat时报错如下:

.5.

Feb 27, 2013 12:18:00 AM org.apache.catalina.core.AprLifecycleListener init

INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], ra

ndom [true].

Feb 27, 2013 12:18:01 AM org.apache.catalina.core.AprLifecycleListener initializ

eSSL

INFO: OpenSSL successfully initialized (OpenSSL 1.0.1c 10 May 2012)

Feb 27, 2013 12:18:01 AM org.apache.coyote.AbstractProtocol init

INFO: Initializing ProtocolHandler ["http-apr-8084"]

Feb 27, 2013 12:18:01 AM org.apache.coyote.AbstractProtocol init

INFO: Initializing ProtocolHandler ["ajp-apr-8009"]

Feb 27, 2013 12:18:01 AM org.apache.catalina.startup.Catalina load

INFO: Initialization processed in 1026 ms

Feb 27, 2013 12:18:01 AM org.apache.catalina.core.StandardService startInternal

INFO: Starting service Catalina

Feb 27, 2013 12:18:01 AM org.apache.catalina.core.StandardEngine startInternal

INFO: Starting Servlet Engine: Apache Tomcat/7.0.30

Feb 27, 2013 12:18:01 AM org.apache.catalina.startup.HostConfig deployDirectory

INFO: Deploying web application directory C:\kunlunsoft\exam2\tomcat\webapps\doc

s

Feb 27, 2013 12:18:01 AM org.apache.catalina.startup.HostConfig deployDirectory

INFO: Deploying web application directory C:\kunlunsoft\exam2\tomcat\webapps\exa

m004

Feb 27, 2013 12:18:01 AM org.apache.catalina.loader.WebappClassLoader validateJa

rFile

INFO: validateJarFile(C:\kunlunsoft\exam2\tomcat\webapps\exam004\WEB-INF\lib\ser

vlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending c

lass: javax/servlet/Servlet.class

Feb 27, 2013 12:18:08 AM org.apache.catalina.core.ContainerBase addChildInternal

SEVERE: ContainerBase.addChild: start:

org.apache.catalina.LifecycleException: Failed to start component [StandardEngin

e[Catalina].StandardHost[localhost].StandardContext[/exam004]]

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

        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase

.java:901)

        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:87

7)

        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618)

        at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.jav

a:1100)

        at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig

.java:1618)

        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)

        at java.util.concurrent.FutureTask.run(Unknown Source)

        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source

)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

        at java.lang.Thread.run(Unknown Source)

Caused by: java.lang.NullPointerException

        at org.springframework.web.SpringServletContainerInitializer.onStartup(S

pringServletContainerInitializer.java:142)

        at org.apache.catalina.core.StandardContext.startInternal(StandardContex

t.java:5274)

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

        ... 11 more

Feb 27, 2013 12:18:08 AM org.apache.catalina.startup.HostConfig deployDirectory

SEVERE: Error deploying web application directory C:\kunlunsoft\exam2\tomcat\web

apps\exam004

java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catal

ina.LifecycleException: Failed to start component [StandardEngine[Catalina].Stan

dardHost[localhost].StandardContext[/exam004]]

        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase

.java:904)

        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:87

7)

        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618)

        at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.jav

a:1100)

        at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig

.java:1618)

        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)

        at java.util.concurrent.FutureTask.run(Unknown Source)

        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source

)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

        at java.lang.Thread.run(Unknown Source)

Feb 27, 2013 12:18:08 AM org.apache.catalina.startup.HostConfig deployDirectory

INFO: Deploying web application directory C:\kunlunsoft\exam2\tomcat\webapps\hos

t-manager

Feb 27, 2013 12:18:08 AM org.apache.catalina.startup.HostConfig deployDirectory

INFO: Deploying web application directory C:\kunlunsoft\exam2\tomcat\webapps\man

ager

Feb 27, 2013 12:18:08 AM org.apache.catalina.startup.HostConfig deployDirectory

INFO: Deploying web application directory C:\kunlunsoft\exam2\tomcat\webapps\ROO

T

Feb 27, 2013 12:18:08 AM org.apache.coyote.AbstractProtocol start

INFO: Starting ProtocolHandler ["http-apr-8084"]

Feb 27, 2013 12:18:08 AM org.apache.coyote.AbstractProtocol start

INFO: Starting ProtocolHandler ["ajp-apr-8009"]

Feb 27, 2013 12:18:08 AM org.apache.catalina.startup.Catalina start

INFO: Server startup in 7167 ms

仔细看异常抛出过程就会发现,一定是与Spring有关系,当前我使用的Spring版本为3.1.0.M2,又是一顿折腾,半天又过去了,最后解决问题的还是google,看来以后有问题还是直接google的好,不要指望其它了,不过或许我写了这个记录后,可以有其它选择了。

  原来这是spring的一个BUG吧,可去https://jira.springsource.org/browse/SPR-8496查看一下,当前需要做的就是更新Spring到新的版本应该就可以了,于是到官网下载Spring3.2.0.RELEASE版本,等待。。。(下载中)

下载后,包结构有一点点变化,对比后更新相应的jar包,再次启动tomcat7,一切正常!!!

相关推荐