Avoid cyclic reference inheritance in grails

10,347

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.

Share:
10,347
NiBE
Author by

NiBE

Updated on June 08, 2022

Comments

  • NiBE
    NiBE almost 2 years

    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!

  • Ondrej Burkert
    Ondrej Burkert almost 8 years
    Nice, works like a charm. Since I take care of a multimodule Maven project, it helped me to search for where it comes from with: mvn dependency:tree -Dverbose -Dincludes=org.bouncycastle