天天看点

Tomcat7+Spring3异常Failed to start component

结果启动tomcat时报错如下:

.6.

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"]

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

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.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]]

.java:904)

info: deploying web application directory c:\kunlunsoft\exam2\tomcat\webapps\hos

t-manager

info: deploying web application directory c:\kunlunsoft\exam2\tomcat\webapps\man

ager

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"]

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

解决办法:

后来 在网上查了好长时间,看到了如下文章:

http://hi.baidu.com/renyijiu/item/9dfda05328afe7464eff20b7

把 spring 的版本更新为3.2.1.release ,问题就解决了。