您的位置:首页 > 运维架构 > Tomcat

tomcat启动内存堆栈溢出ASN1EncodableVector,DEREncodableVector循环依赖

2018-04-03 11:04 477 查看
主要问题Caused by: java.lang.IllegalStateException: Unable to complete the scan for annotations for web application [] 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]
解决的手段1、有的说调整tomcat的xss大小,就是tomcat的启动参数,然而在这里没什么用,-xss =1024m(如果是循环依赖,内存再大也是死循环会用完)。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">  
问题原因红色部分为报错的根本原因:是jvm的栈溢出问题;而导致栈溢出的根本原因是由于蓝色部分显示的jar包冲突,这种情况是有两个jar都含有上述相同的类名,且继承关系刚好相反,故造成tomcat启动的环问题。ASN1EncodableVector依赖DEREncodableVector,DEREncodableVector依赖ASN1EncodableVector形成死循环。解决方法找到lib下面的jar集,


这里打开所有的jar后,发现DEREncodableVector和ASN1EncodableVector在bcmail-jdk14-1.38.jar及下面的三个包都存在,删掉重复的,部署访问成功。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息