问题描述
我有一个用Grails 2.3.8编写的大项目。有时当我使用我的CI进行部署时,我收到了以下消息:
无法完成扫描Web应用程序的注释[/ ProjectName ## 1152],原因是一个StackOverflowError。
可能的根本原因包括对-Xss和非法循环继承依赖关系的设置太低。
正在处理的类层次结构是 [org.bouncycastle.asn1.ASN1EncodableVector-> org.bouncycastle.asn1.DEREncodableVector-> org.bouncycastle.asn1.ASN1EncodableVector] strong>
我已经增加了Xss设置,但很明显,但也许我错了,有一个循环引用:
org.bouncycastle .asn1.ASN1EncodableVector-> org.bouncycastle.asn1.DEREncodableVector-> org.bouncycastle.asn1.ASN1EncodableVector
我可以避免检查的红色,我无法删除因为我需要它的图书馆。但我不知道如何在Grails中做到这一点。我可以排除它们,但它不是我想要的。
非常感谢任何建议
nibe
p> 更新
我刚解决了这个问题。我删除了buildConfig文件中的每个bouncycastle库的踪迹。无依赖或排除痕迹。只需在crypto.2.0中添加插件,一切正常!
我认为这是因为两个版本的JAR被引用classpath。
这通常是在加载不同版本的 bcprov-jdk * .jar 时引起的。
例如,在我的一个场景中 - 我有
.... / webapps / FOO / WEB-INF / lib / bcprov-jdk15on-147.jar
.... / webapps / FOO / WEB-INF / lib / bcprov -jdk15on-1.51.jar
在从我的类路径中删除它们之后,我解决了这个问题。
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!
解决方案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.
这篇关于在grails中避免循环引用继承的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!