Tomcat7+Spring3异常Failed to start component

简介:

我做的一个考试系统,使用了hibernatespring,原来使用的tomcat版本是6,后来把tomcat换成了apache-tomcat-7.0.30-windows-x64,spring的版本是:3.1

结果启动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"]

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

 

解决办法

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

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

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

相关文章
|
8月前
|
安全 Java 应用服务中间件
阿里技术官架构使用总结:Spring+MyBatis源码+Tomcat架构解析等
分享Java技术文以及学习经验也有一段时间了,实际上作为程序员,我们都清楚学习的重要性,毕竟时代在发展,互联网之下,稍有一些落后可能就会被淘汰掉,因此我们需要不断去审视自己,通过学习来让自己得到相应的提升。
|
3月前
|
Java 应用服务中间件 Maven
idea+maven+tomcat+spring 创建一个jsp项目
这篇文章介绍了如何在IntelliJ IDEA中使用Maven和Tomcat创建一个JSP项目,包括配置Maven依赖、设置Tomcat服务器、编写JSP页面、创建控制器和配置文件,以及项目的运行结果。
260 0
idea+maven+tomcat+spring 创建一个jsp项目
|
5月前
|
Java Spring
【Azure 应用服务】记一次Azure Spring Cloud 的部署错误 (az spring-cloud app deploy -g dev -s testdemo -n demo -p ./hellospring-0.0.1-SNAPSHOT.jar --->>> Failed to wait for deployment instances to be ready)
【Azure 应用服务】记一次Azure Spring Cloud 的部署错误 (az spring-cloud app deploy -g dev -s testdemo -n demo -p ./hellospring-0.0.1-SNAPSHOT.jar --->>> Failed to wait for deployment instances to be ready)
|
8月前
|
Java 应用服务中间件 Maven
解决“Unable to start embedded Tomcat“错误的完整指南
通过逐步检查以上问题,你应该能够解决 "Unable to start embedded Tomcat" 错误,并使Tomcat成功启动。
1866 1
解决“Unable to start embedded Tomcat“错误的完整指南
|
7月前
|
XML 应用服务中间件 Android开发
【已解决】eclipse导入项目出错 Server Tomcat v7.0 Server at localhost failed to start
【已解决】eclipse导入项目出错 Server Tomcat v7.0 Server at localhost failed to start
65 0
|
8月前
|
Dubbo Java 应用服务中间件
启动tomcat时,卡主在信息: Initializing Spring FrameworkServlet 'e3-manager'
启动tomcat时,卡主在信息: Initializing Spring FrameworkServlet 'e3-manager'
53 0
|
8月前
|
Java Maven 开发工具
Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.3.RELEASE:repac
Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.3.RELEASE:repac
60 0
|
8月前
|
Java 应用服务中间件
完美解决tomcat启动异常:Invalid byte tag in constant pool: 19;Unable to process Jar entry [module-info.class]
完美解决tomcat启动异常:Invalid byte tag in constant pool: 19;Unable to process Jar entry [module-info.class]
1370 0
|
8月前
|
Java Spring
Initialization failed for 'https://start.spring.io' Please check URL, network and proxy settings.
Initialization failed for 'https://start.spring.io' Please check URL, network and proxy settings.
1182 0
|
8月前
|
Java 应用服务中间件 Linux
Tomcat异常实践总结
Tomcat异常实践总结
136 0