避免 grails 中的循环引用继承 [英] Avoid cyclic reference inheritance in grails

查看:34
本文介绍了避免 grails 中的循环引用继承的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用 Grails 2.3.8 编写的大项目.有时,当我使用 CI 部署它时,我会收到以下消息:

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

由于 StackOverflowError,无法完成对 Web 应用程序 [/ProjectName##1152] 的注释扫描.

可能的根本原因包括 -Xss 设置过低和非法循环继承依赖项.正在处理的类层次结构是[org.bouncycastle.asn1.ASN1EncodableVector->org.bouncycastle.asn1.DEREncodableVector->org.bouncycastle.asn1.ASN1EncodableVector]

我已经增加了 Xss 设置,但很明显,但也许我错了,有一个循环引用: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

我认为您可以避免检查,因为我需要它,所以我无法删除该库.但我不知道如何在 Grails 中做到这一点.我可以排除它们,但这不是我想要的.

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.

非常感谢您的建议

尼贝

更新我刚刚解决了这个问题.我删除了 buildConfig 文件中 bouncycastle 库的所有痕迹.没有任何依赖或排除的痕迹.只需在crypto.2.0中添加插件,一切正常!

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!

推荐答案

我认为这是因为从类路径中引用了两个版本的 JAR.

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

这通常是在加载不同版本的bcprov-jdk*.jar 时引起的.

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 中的循环引用继承的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆