我正在使用 STS(eclipse 插件)和 maven 开发一个 Spring MVC 应用程序。
为了创建项目,我按照 STS 向导创建了一个新的“Spring MVC 项目”。之后,我在其他项目和库中添加了一些依赖项。
但是,当我现在尝试将项目部署到 STS 的集成 vFabric 服务器时,有时会遇到异常:
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”并重新启动服务器时,有时不会抛出异常并且应用程序运行正常。然而,大多数时候,它不起作用。
我想没有必要为注解扫描 bouncycaSTLe 依赖项。
我可以以某种方式禁用对某些 jar 的扫描吗?
我已经尝试将 metadata-complete="true"
添加到我的 web.xml 并增加堆栈大小但没有结果。
我能做些什么来解决这个问题?
最佳答案
在我的例子中,导致循环依赖的 org.bouncycaSTLe.asn1.DEREncodableVector
类由类路径中的两个 jar 提供。
bcprov-jdk15on-1.47.jar
和 bcprov-jdk16-1.45.jar
排除了不需要的jar(bcprov-jdk16-1.45.jar),效果很好
关于java - 由于 StackOverflowError,无法完成对 Web 应用程序 [/app] 注释的扫描,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17584495/