由于 StackOverflowError,无法完成对 Web 应用程序 [/app] 注释的扫描 [英] Unable to complete the scan for annotations for web application [/app] due to a StackOverflowError
问题描述
我正在使用 STS(eclipse 插件)和 maven 开发 Spring MVC 应用程序.
I am developing a Spring MVC application using STS (eclipse plugin) and maven.
为了创建项目,我按照 STS 向导创建了一个新的Spring MVC 项目".之后,我为其他项目和库添加了一些依赖项.
For creating the project, I followed the STS wizard for a new "Spring MVC project". Afterwards, I added some dependencies to other projects and libraries.
但是,当我现在尝试将项目部署到 STS 的集成 vFabric 服务器时,有时会出现异常:
However, when I am now trying to deploy the project to the integrated vFabric server of STS, I sometimes get an exception:
SEVERE: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/wsa]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
...
Caused by: java.lang.IllegalStateException: Unable to complete the scan for annotations for web application [/app] 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]
at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:2179)
...
当发出maven clean",然后是maven install"并重启服务器时,有时不会抛出异常并且应用程序运行良好.然而,大多数情况下,它不起作用.
When issuing a "maven clean", followed by a "maven install" and a restart of the server, the exception sometimes doesn't get thrown and the application works fine. Yet, most of the times, it doesn't work.
我想不需要扫描 bouncycastle 依赖项以获取注释.
我可以以某种方式禁用对某些 jar 的扫描吗?
I guess there is no need to scan the bouncycastle dependencies for annotations.
Can I somehow disable this scanning for some jars?
我已经尝试将 metadata-complete="true"
添加到我的 web.xml 并增加堆栈大小但没有结果.
I already tried adding metadata-complete="true"
to my web.xml and increasing the stack size with no result.
我该怎么做才能解决这个问题?
What can I do to fix this?
推荐答案
就我而言,导致循环依赖的 org.bouncycastle.asn1.DEREncodableVector
类由两个 jar 提供类路径.
In my case the org.bouncycastle.asn1.DEREncodableVector
class, which was causing the cyclic dependency, was served by two jars in the class path.
bcprov-jdk15on-1.47.jar
和 bcprov-jdk16-1.45.jar
排除不需要的 jar(bcprov-jdk16-1.45.jar) 并且运行良好
Excluded the unwanted jar(bcprov-jdk16-1.45.jar) and it worked well
这篇关于由于 StackOverflowError,无法完成对 Web 应用程序 [/app] 注释的扫描的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!