Tomcat 启动 异常 java.lang.IllegalStateException: Unable to complete the scan for annotations...
2015-07-06 22:01
711 查看
最近在使用tomcat 部署应用是遇到异常如下:
分析原因:tomcat 启动扫描注解时抛出异常 StackOverflowError,扫描具体类为:
从以下方面检查错误:
1. 栈内存不足,修改tomcat启动参数,增加栈内存, 如:-Xss100m
2. 在你的应用中告诉tomcat不要扫描annotations, 修改web.xml 如下:
Caused by: java.lang.IllegalStateException: Unable to complete the scan for annotations for web application [/xxxx] due to a StackOverflowError. Possible root causes include a too low setting for -Xss and illegal cyclic inheritance dependencies. The class hierarchy being processed was [org.bouncycastle.asn1.ASN1EncodableVector->org.bouncycastle.asn1.DEREncodableVector->org.bouncycastle.asn1.ASN1EncodableVector] at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:2188) at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2135) at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:2010) at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1976) at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1961) at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1319) at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:376) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5322) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ... 10 more
分析原因:tomcat 启动扫描注解时抛出异常 StackOverflowError,扫描具体类为:
org.bouncycastle.asn1.ASN1EncodableVector->org.bouncycastle.asn1.DEREncodableVector->org.bouncycastle.asn1.ASN1EncodableVector
从以下方面检查错误:
1. 栈内存不足,修改tomcat启动参数,增加栈内存, 如:-Xss100m
2. 在你的应用中告诉tomcat不要扫描annotations, 修改web.xml 如下:
<web-app id="WebApp_ID" version="2.4" metadata-complete="true" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">[/code]
[/code]
3. 限制tomcat扫描jar 文件,参考:http://tomcat.apache.org/tomcat-7.0-doc/config/jar-scanner.html
4. 另外, 你可以创建一个war包,其中在WEB-INF\lib中包含第三方依赖的jar, 当启动tomcat时,如果发现错误信息类似如下:Unable to complete the scan for annotations for web application [/xxxx] due to a StackOverflowError. Possible root causes include a too low setting for -Xss and illegal cyclic inheritance dependencies. The class hierarchy being processed was [org.bouncycastle.asn1.ASN1EncodableVector->org.bouncycastle.asn1.DEREncodableVector->org.bouncycastle.asn1.ASN1EncodableVector]
这个可能是第三方api的一个bug.可以到其官网下载最新版本看看是否修复。
相关文章推荐
- Linux+Nginx+Tomcat 多域名,多应用在同一服务器的配置
- linux tomcat 安装步骤
- jsp项目部署到tomcat下的执行流程
- Mac下Tomcat的安装与配置
- apache转发客户端端口到tomcat的配置 以及 apache日志格式的配置
- tomcat 预览出现501错误
- 如何解决Tomcat服务器的stdout.log大文件问题
- 解决Eclipse发布webproject, jar无法发布到tomcat lib目录下的问题
- 常用软件包和插件
- Tomcat服务器工作原理
- (Apache+Tomcat+mysql)(集成环境)+花生壳2.2
- tomcat配置虚拟主机
- 一台电脑安装多个tomcat
- TOMCAT 独立用户启动配置 安全部署
- IDEA 13 tomcat 进行远程调试
- 安装tomcat for Mac
- Tomcat Server.xml详解
- Tomcat web.xml元素详解
- centos下解决tomcat实时日志乱码问题
- 关于android在TOMCAT服务器下载文件名带中文的文件的编码问题