Tomcat启动失败问题解决
1. 系统框架加载正常,但是Tomcat启动失败,报错如下:
- 2013-7-26 17:18:33 org.apache.catalina.core.StandardContext startInternal
- 严重: Error listenerStart
- 2013-7-26 17:18:34 org.apache.catalina.util.SessionIdGenerator createSecureRandom
- 信息: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [452] milliseconds.
- 2013-7-26 17:18:34 org.apache.catalina.core.StandardContext startInternal
- 严重: Context [] startup failed due to previous errors
- 2013-7-26 17:18:34 org.apache.coyote.AbstractProtocol start
- 信息: Starting ProtocolHandler ["http-apr-8080"]
- 2013-7-26 17:18:34 org.apache.coyote.AbstractProtocol start
- 信息: Starting ProtocolHandler ["ajp-apr-8009"]
- 2013-7-26 17:18:34 org.apache.catalina.startup.Catalina start
- 信息: Server startup in 9576 ms
- diamond client log path : /home/admin/xxx/target/../logs/xx-client.log
- 2013-7-26 17:18:57 org.apache.catalina.loader.WebappClassLoader loadClass
- 信息: Illegal access: this web application instance has been stopped already. Could not load javax.xml.parsers.ParserConfigurationException. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
- java.lang.IllegalStateException
- at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1587)
- at com.taobao.tomcat.classloader.TomcatWebAppClassLoader.loadClass(TomcatWebAppClassLoader.java:37)
- at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1546)
- at com.taobao.hsf.container.HSFClassLoaderDelegateHook.postFindClass(HSFClassLoaderDelegateHook.java:96)
- at org.eclipse.osgi.framework.internal.core.BundleLoader.searchHooks(BundleLoader.java:495)
- at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:461)
- at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:397)
- at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:385)
- at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:87)
2013-7-26 17:18:33 org.apache.catalina.core.StandardContext startInternal
严重: Error listenerStart
2013-7-26 17:18:34 org.apache.catalina.util.SessionIdGenerator createSecureRandom
信息: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [452] milliseconds.
2013-7-26 17:18:34 org.apache.catalina.core.StandardContext startInternal
严重: Context [] startup failed due to previous errors
2013-7-26 17:18:34 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-apr-8080"]
2013-7-26 17:18:34 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-apr-8009"]
2013-7-26 17:18:34 org.apache.catalina.startup.Catalina start
信息: Server startup in 9576 ms
diamond client log path : /home/admin/xxx/target/../logs/xx-client.log
2013-7-26 17:18:57 org.apache.catalina.loader.WebappClassLoader loadClass
信息: Illegal access: this web application instance has been stopped already. Could not load javax.xml.parsers.ParserConfigurationException. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1587)
at com.taobao.tomcat.classloader.TomcatWebAppClassLoader.loadClass(TomcatWebAppClassLoader.java:37)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1546)
at com.taobao.hsf.container.HSFClassLoaderDelegateHook.postFindClass(HSFClassLoaderDelegateHook.java:96)
at org.eclipse.osgi.framework.internal.core.BundleLoader.searchHooks(BundleLoader.java:495)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:461)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:397)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:385)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:87)
2. 分析
查看上述日志,可能会很明显的看到下面很多的exception。都是this web application instance has been stopped already以及Could not load XX Class。但是不要被这些异常迷惑,他们只是结果而不是原因。
1). 细致一点可以查看到,哪些日志是Tomcat是启动完成之后报错的。Server startup in 9576 ms
2). Tomcat日志中有:严重: Error listenerStart。
3). 除了Error listenerStart没有详细日志,但是可以知道是web.xml中listener初始化的时候出错了。
3. 处理
1). 在WEB-INF/classes目录下新建logging.properties
- handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
- ############################################################
- # Handler specific properties.
- # Describes specific configuration info for Handlers.
- ############################################################
- org.apache.juli.FileHandler.level = FINE
- org.apache.juli.FileHandler.directory = ${应用目录}/logs
- org.apache.juli.FileHandler.prefix = error-debug.
- java.util.logging.ConsoleHandler.level = FINE
- java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHandler ############################################################Handler specific properties.
Describes specific configuration info for Handlers.
############################################################ org.apache.juli.FileHandler.level = FINE
org.apache.juli.FileHandler.directory = ${应用目录}/logs
org.apache.juli.FileHandler.prefix = error-debug. java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
2). 重新启动应用,指定目录下会有一个error-debug.2013-07-07.log的错误日志,或者错误日志生成在jboss_stdout.log中。(日志在Error listenerStart 到 Server startup in 9576 ms之间)
4. 结果
- 2013-7-29 9:58:11 org.apache.catalina.core.ApplicationContext log
- 信息: Initializing Spring root WebApplicationContext
- 2013-7-29 9:58:16 org.apache.catalina.core.StandardContext listenerStart
- 严重: Exception sending context initialized event to listener instance of class com.alibaba.citrus.webx.context.WebxContextLoaderListener
- org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:web/common/uris.xml]
- Offending resource: ServletContext resource [/WEB-INF/webx.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [web/common/uris.xml]; nested exception is java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseBeanDefinitionAttributes(Lorg/w3c/dom/Element;Ljava/lang/String;Lorg/springframework/beans/factory/config/BeanDefinition;Lorg/springframework/beans/factory/support/AbstractBeanDefinition;)Lorg/springframework/beans/factory/support/AbstractBeanDefinition;
- Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [web/common/uris.xml]; nested exception is java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseBeanDefinitionAttributes(Lorg/w3c/dom/Element;Ljava/lang/String;Lorg/springframework/beans/factory/config/BeanDefinition;Lorg/springframework/beans/factory/support/AbstractBeanDefinition;)Lorg/springframework/beans/factory/support/AbstractBeanDefinition;
- Caused by: java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseBeanDefinitionAttributes(Lorg/w3c/dom/Element;Ljava/lang/String;Lorg/springframework/beans/factory/config/BeanDefinition;Lorg/springframework/beans/factory/support/AbstractBeanDefinition;)Lorg/springframework/beans/factory/support/AbstractBeanDefinition;
- at com.alibaba.citrus.springext.util.SpringExtUtil.parseBeanDefinitionAttributes(SpringExtUtil.java:223)
- at com.alibaba.citrus.service.uribroker.impl.URIBrokerServiceDefinitionParser.doParse(URIBrokerServiceDefinitionParser.java:48)
- at org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser.parseInternal(AbstractSingleBeanDefinitionParser.java:81)
- at org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.parse(AbstractBeanDefinitionParser.java:56)
- at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69)
- at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1123)
- at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1113)
- at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:133)
- at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:90)
- at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:468)
- at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:363)
2013-7-29 9:58:11 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
2013-7-29 9:58:16 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class com.alibaba.citrus.webx.context.WebxContextLoaderListener
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:web/common/uris.xml]
Offending resource: ServletContext resource [/WEB-INF/webx.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [web/common/uris.xml]; nested exception is java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseBeanDefinitionAttributes(Lorg/w3c/dom/Element;Ljava/lang/String;Lorg/springframework/beans/factory/config/BeanDefinition;Lorg/springframework/beans/factory/support/AbstractBeanDefinition;)Lorg/springframework/beans/factory/support/AbstractBeanDefinition;
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [web/common/uris.xml]; nested exception is java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseBeanDefinitionAttributes(Lorg/w3c/dom/Element;Ljava/lang/String;Lorg/springframework/beans/factory/config/BeanDefinition;Lorg/springframework/beans/factory/support/AbstractBeanDefinition;)Lorg/springframework/beans/factory/support/AbstractBeanDefinition;
Caused by: java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseBeanDefinitionAttributes(Lorg/w3c/dom/Element;Ljava/lang/String;Lorg/springframework/beans/factory/config/BeanDefinition;Lorg/springframework/beans/factory/support/AbstractBeanDefinition;)Lorg/springframework/beans/factory/support/AbstractBeanDefinition;
at com.alibaba.citrus.springext.util.SpringExtUtil.parseBeanDefinitionAttributes(SpringExtUtil.java:223)
at com.alibaba.citrus.service.uribroker.impl.URIBrokerServiceDefinitionParser.doParse(URIBrokerServiceDefinitionParser.java:48)
at org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser.parseInternal(AbstractSingleBeanDefinitionParser.java:81)
at org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.parse(AbstractBeanDefinitionParser.java:56)
at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1123)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1113)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:133)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:90)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:468)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:363)
5. 看到上述日志,问题就很容易解决了,明显是由于spring的类冲突导致,分析之后发现,是由于spring-2.0.7与spring-2.5.6的类冲突导致。
6. 如果上述不行,可以尝试:
http://www.havenliu.com/web/298.html
http://grails.1312388.n4.nabble.com/Deployment-problems-td4628710.html
http://xpenxpen.iteye.com/blog/1545648
Tomcat启动失败问题解决的更多相关文章
- Tomcat启动失败:java.lang.NoSuchMethodError: org.apache.tomcat.util.res.StringManager.getManager(Ljava/lang/Class;)Lorg/apache/tomcat/util/res/StringManager
项目开发中发现服务器上Tomcat启动失败 开始定位 第一步:打开tomcat日志catalina.log: 2017-07-25 17:02:43,799 [Catalina-startStop-1 ...
- Tomcat启动失败 提示Server Tomcat v7.0 Server at localhost failed to start.六种解决方法
Tomcat启动失败,提示Server Tomcat v7.0 Server at localhost failed to start 在一次查看自己以前写过的项目中,运行tomcat失败,出现如图提 ...
- Java tomcat启动失败(Servlet3.0 Web Project):A child container failed during start
Tomcat启动失败,失败全部信息: 五月 , :: 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin 警告: [SetProper ...
- Sonatype Nexus 服务启动失败问题解决
Sonatype Nexus 服务启动失败问题解决 问题前述: 近日在开发机本机安装了 Oracle 数据库快捷版 11g2 之后,重启电脑后发现本机的maven代理服务无法访问. 现象 通过 Win ...
- Java Tomcat 启动失败的解决思路
好久没写新博文了,离自己要求的每年几篇的目标也是渐行渐远. 最近在学习Java,也是从基础学习,因为我是一个.net开发人员,所以学习的成本相对低些.Java JDK,JRE,Tomact 的安装及配 ...
- tomcat启动失败问题排除及解决办法 Server Tomcat v7.0 Server at localhost failed to start.
tomcat启动失败问题排除及解决办法 Server Tomcat v7.0 Server at localhost failed to start. 导致上面问题的原因可能有很多种,每种的解决办法都 ...
- tomcat 启动失败 和闪退 和 启动成功却没有页面显示
1.解压版tomcat 将tomcat解压至英文目录下, 在系统环境变量里面配置 JAVA_HOME 和CATALINA_HOME (就是tomcat的安装目录) 在path中配置 %CATALINA ...
- tomcat启动失败的三种方法
Tomcat启动失败的解决办法 1. 重复映射 用eclipse开发时,用Eclipse开发,新建了的servlet会有一个url-pattern声明: 这样就不需要再在web.xml中添加映射,如果 ...
- Tomcat启动失败原因
Tomcat启动失败原因 一.Tomcat启动时,要求被加载的项目必须拥有独立路径名称 发布的两个工程具有相同路径名称,这是不允许. 二.8080端口号已经被占用了 启动失败原因,就是8085端口上, ...
随机推荐
- Android Material风格的应用(五)--CollapsingToolbar
Collapsing Toolbar Android Material风格的应用(一)--AppBar TabLayoutAndroid Material风格的应用(二)--RecyclerViewA ...
- 目标识别(object detection)中的 IoU(Intersection over Union)
首先直观上来看 IoU 的计算公式: 由上述图示可知,IoU 的计算综合考虑了交集和并集,如何使得 IoU 最大,需要满足,更大的重叠区域,更小的不重叠的区域. 两个矩形窗格分别表示: 左上点.右下点 ...
- ios 不支持屏幕旋转
- (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait; }
- POJ 3100 Root of the Problem || 1004 Financial Management 洪水!!!
水两发去建模,晚饭吃跟没吃似的,吃完没感觉啊. ---------------------------分割线"水过....."--------------------------- ...
- Android基础新手教程——1.2 开发环境搭建
Android基础新手教程--1.2 开发环境搭建 标签: Android基础新手教程 如今主流的Android开发环境有: ①Eclipse + ADT + SDK ②Android Studio ...
- 数据类型总结——Boolean类型(布尔类型)
相关文章 简书原文:https://www.jianshu.com/p/e5c75d4be636 数据类型总结——概述:https://www.cnblogs.com/shcrk/p/9266015. ...
- [AHK]自定义默认浏览器
https://blog.csdn.net/liuyukuan/article/details/78844383
- java异常中Exception捕获不到的异常
一 概念 众所周知java提供了丰富的异常类,这些异常类之间有严格的集成关系,分类为 父类Throwable Throwable的两个子类Error和Exception Exception的两个子类C ...
- PatentTips - Highly-available OSPF routing protocol
BACKGROUND OF THE INVENTION FIG. 1A is a simplified block diagram schematically representing a typic ...
- C++设计模式实现--备忘录(Memento)模式
一. 备忘录模式 定义:在不破坏封装性的前提下,捕获一个对象的内部状态.并在该对象之外保存这个状态. 这样以后就可将该对象恢复到原先保存的状态. 结构图: 使用范围: Memento 模式比較适用于功 ...