martes, 24 de agosto de 2021

47. Tomcat stackoverflow in org.bouncycastle.en1 ..

 In this error, that basically says:

Unable to complete the scan for annotations for web application [/WEBPROP] 
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.ASN1OutputStream->
   org.bouncycastle.asn1.DEROutputStream->
   org.bouncycastle.asn1.ASN1OutputStream
  ]

I have created a file setenv.sh in the bin folder of tomcat with this content 

export JAVA_HOME=/home/ximo/MyPrograms/jdk-15.0.2+7.OpenJ7

export CATALINA_OPTS="$CATALINA_OPTS -Xms1G -Xmx7G -Xss256M"  //DON'T WORK!!

If you don't have a StackOverflow error when increasing the Xss size you may get an OutOfMemory error, or even Tomcat cannot startup!!!

So you must try the Xss parameter ???

The question is solved in StackOverflow and there are 2 versions of the bcpprov-jdkXXXX.war in the dependencies.

In my case, this fact was due to the use of IText in its last version and JasperReports that uses internally IText v.2 





java.lang.IllegalStateException: Error starting child

        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:729)

        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:698)

        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:696)

        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1024)

        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1911)

        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)

        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

        at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)

        at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:118)

        at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:825)

        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:475)

        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1618)

        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:319)

        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)

        at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)

        at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)

        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:946)

        at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835)

        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)

        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)

        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)

        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

        at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)

        at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)

        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)

        at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263)

        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)

        at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432)

        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)

        at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927)

        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)

        at org.apache.catalina.startup.Catalina.start(Catalina.java:772)

        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)

        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.base/java.lang.reflect.Method.invoke(Method.java:564)

        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)

        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476)

Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/WEBPROP]]

        at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)

        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)

        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726)

        ... 37 more

java.lang.IllegalStateException: Error starting child

        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:729)

        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:698)

        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:696)

        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1024)

        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1911)

        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)

        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

        at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)

        at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:118)

        at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:825)

        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:475)

        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1618)

        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:319)

        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)

        at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)

        at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)

        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:946)

        at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835)

        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)

        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)

        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)

        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

        at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)

        at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)

        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)

        at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263)

        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)

        at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432)

        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)

        at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927)

        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)

        at org.apache.catalina.startup.Catalina.start(Catalina.java:772)

        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)

        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.base/java.lang.reflect.Method.invoke(Method.java:564)

        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)

        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476)

Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/WEBPROP]]

        at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)

        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)

        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726)

        ... 37 more

Caused by: java.lang.IllegalStateException: Unable to complete the scan for annotations for web application [/WEBPROP] 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.ASN1OutputStream->org.bouncycastle.asn1.DEROutputStream->org.bouncycastle.asn1.ASN1OutputStream]

        at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:2404)

        at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2342)

        at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:2294)

        at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:2264)

        at org.apache.catalina.startup.ContextConfig.scanWebXmlFragment(ContextConfig.java:2172)

        at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:2152)

        at org.apache.catalina.startup.ContextConfig.processClasses(ContextConfig.java:1408)

        at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1303)

        at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:986)

        at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:303)

        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)

        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5135)

        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)

        ... 38 more

Caused by: java.lang.IllegalStateException: Unable to complete the scan for annotations for web application [/WEBPROP] 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.ASN1OutputStream->org.bouncycastle.asn1.DEROutputStream->org.bouncycastle.asn1.ASN1OutputStream]

        at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:2404)

        at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2342)

        at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:2294)

        at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:2264)

        at org.apache.catalina.startup.ContextConfig.scanWebXmlFragment(ContextConfig.java:2172)

        at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:2152)

        at org.apache.catalina.startup.ContextConfig.processClasses(ContextConfig.java:1408)

        at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1303)

        at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:986)

        at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:303)

        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)

        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5135)

        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)

        ... 38 more

No hay comentarios:

Publicar un comentario