Tomcat 启动 异常 java.lang.IllegalStateException: Unable to complete the scan for annotations...
来源:互联网 发布:耳鸣 知乎 编辑:程序博客网 时间:2024/05/21 18:42
最近在使用tomcat 部署应用是遇到异常如下:
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">
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.可以到其官网下载最新版本看看是否修复。
1 0
- Tomcat 启动 异常 java.lang.IllegalStateException: Unable to complete the scan for annotations...
- Unable to complete the scan for annotations for web application [] due to a StackOverflowError
- Unable to complete the scan for annotations for web application XXX due to a StackOverflowErr
- Unable to complete the scan for annotations for web application [/xxxx] due to a StackOverflowErro
- Unable to complete the scan for annotations for web application [] due to a StackOverflowError
- Unable to complete the scan for annotations for web application [] due to a StackOverflowError
- eclipse启动报错 java.lang.IllegalStateException: Unable to acquire application service. Ensure that the
- Unable to scan WEB-INF for JAX-RS annotations
- java.lang.IllegalStateException:Unable to create schema compiler
- java.lang.IllegalStateException 异常
- 异常:java.lang.IllegalStateException
- tomcat启动异常,Unable to load configuration.
- java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resol
- Glassfish启动异常: java.lang.IllegalStateException:Class invariant violation
- java.lang.IllegalStateException: Failed to load ApplicationContext异常解决方法
- java.lang.IllegalStateException: Failed to load ApplicationContext异常
- java.lang.IllegalStateException异常解决办法
- java.lang.IllegalStateException异常解决办法
- GIT对VS工程中的无用文件过滤
- NYOJ 124 中位数(水题,nth_element()使用练习)
- LeetCode110 Blanced Binary Tree Java 题解
- C#课程设计:《猜猜看》游戏开发总结
- hdu 1710 Binary Tree Traversals 前序遍历和中序推后序
- Tomcat 启动 异常 java.lang.IllegalStateException: Unable to complete the scan for annotations...
- Android V4包下DrawerLayout的学习及回顾
- Could not find class 'javax.naming.directory.InitialDirContext'的解决办法!
- 操作系统——知识点,填空题
- Python学习笔记
- intellij idea + bitbucket + maven + spring-boot配置记录
- LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
- 求素数
- C#课程考核——猜猜看.