严重: Context [] startup failed due to previous errors

来源:互联网 发布:淘宝定金尾款凑单 编辑:程序博客网 时间:2024/06/05 19:04

项目部署到服务器tomcat启动时报如下错误:

2015-5-7 14:38:25 org.apache.catalina.core.StandardContext startInternal严重: Error listenerStart2015-5-7 14:38:25 org.apache.catalina.core.StandardContext startInternal严重: Context [] startup failed due to previous errors2015-5-7 14:38:25 org.apache.catalina.startup.HostConfig deployDirectory信息: Deployment of web application directory /data/apache-tomcat-7.0.57/webapps/ROOT has finished in 5,288 ms2015-5-7 14:38:25 org.apache.coyote.AbstractProtocol start信息: Starting ProtocolHandler ["http-bio-8080"]2015-5-7 14:38:25 org.apache.coyote.AbstractProtocol start信息: Starting ProtocolHandler ["ajp-bio-8048"]2015-5-7 14:38:25 org.apache.catalina.startup.Catalina start

网上的建议一般集中于以下几点:

  1. web.xml文件 web应用部署描述符,里面的部署的xml文件或者类,如果这些找不到就会发生startup failed due to previous errors错误。
  2. 如果在应用spring的话,在配置文件applicationContext.xml中定义的类、xml文件找不到也会报这个错误。
  3. 在web.xml,struts.xml,applicationContext.xml文件中自身有任何一点错误都可能引起上面的这个问题,而不仅仅是附带的文件错误导致。
  4. 如果使用ibatis的话,在SqlMapConfig.xml中定义的xml文件找不到也会报这个错误。(hibernate的配置在整合spring的时候使用spring的配置文件)
  5. JDK的版本问题,最好使用JDK5.0 或者更高的版本。
  6. Eclipse和tomcat的版本兼容问题
  7. 框架整合的过程中在导入到lib下的jar包冲突也可能产生该错误。
  8. jar包的缺少以及jar包的版本也可产生该错误。
  9. 其他的原因

我的问题描述及最后的解决方式

本机上的jdk版本使用的是1.7,通过myeclipse编译版本也是1.7,服务器上的jdk版本是1.6.
项目中有一些类使用的是1.7的特性,比如switch(String)。而这几个类是在tomcat启动spring时需要加载的。
所以更换了服务器上的jdk版本,使编译版本和运行时版本一致,问题解决。

若还不能解决问题,修改一下tomcat的日志级别,打印更多信息来确定问题的原因。

0 0
原创粉丝点击