Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
464 views
in Technique[技术] by (71.8m points)

bouncycastle - Avoid cyclic reference inheritance in grails

I have a big project written in Grails 2.3.8. Sometimes when I deploy it using my CI I got this message:

Unable to complete the scan for annotations for web application [/ProjectName##1152] 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]

I have already increased the Xss settings, but it's clear, but maybe I'm wrong, that there is a cyclic reference : org.bouncycastle.asn1.ASN1EncodableVector->org.bouncycastle.asn1.DEREncodableVector->org.bouncycastle.asn1.ASN1EncodableVector

I red that you can just avoid the checking, I cannot remove the library because I need it. But I have not idea how to do it in Grails. I can exclude them but it's not what I want.

thanks a lot for any advices

nibe

UPDATE I just fixed the issue. I remove every trace of bouncycastle library in the buildConfig file. No trace in dependecy or excludes. Just add the plug in crypto.2.0 and everything works fine!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I think its because of two versions of JAR being referenced from classpath.

This is usually caused when different versions of bcprov-jdk*.jar being loaded.

For example, IN one of my scenario - I had 

..../webapps/FOO/WEB-INF/lib/bcprov-jdk15on-147.jar
..../webapps/FOO/WEB-INF/lib/bcprov-jdk15on-1.51.jar 

I got this resolved after removing any one of them from my classpath.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...