OpenShift Tomcat Error Annotations War Deployment Error

I updated the java war with an open shift, and after updating the application will not start. When I looked at the jbossews log file, I found the problem but cannot duplicate it outside of OpenShift. This reflects well on tomcat locally.

I get a series of processing errors until the application leaves the heap area:

May 22, 2015 12:04:16 AM org.apache.catalina.startup.ContextConfig processAnnotationsJar SEVERE: Unable to process Jar entry [javassist/ByteArrayClassPath.class] from Jar [jar:jndi:/localhost/cope/WEB-INF/lib/javassist-3.19.0-GA.jar!/] for annotations java.io.EOFException at java.io.DataInputStream.readUnsignedShort(DataInputStream.java:340) at org.apache.tomcat.util.bcel.classfile.Utility.swallowMethodParameters(Utility.java:797) at org.apache.tomcat.util.bcel.classfile.Attribute.readAttribute(Attribute.java:171) at org.apache.tomcat.util.bcel.classfile.FieldOrMethod.<init>(FieldOrMethod.java:57) at org.apache.tomcat.util.bcel.classfile.Method.<init>(Method.java:71) at org.apache.tomcat.util.bcel.classfile.ClassParser.readMethods(ClassParser.java:267) at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:127) at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2058) at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1934) at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1900) at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1885) at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1317) at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:876) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:374) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5355) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1083) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1880) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) 

This continues until the following:

 May 22, 2015 12:04:17 AM org.apache.catalina.startup.HostConfig deployWARs SEVERE: Error waiting for multi-thread deployment of WAR files to complete java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:188) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:818) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1614) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:330) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402) at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:347) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1140) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:799) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.OutOfMemoryError: Java heap space 

What am I missing here?

+4
source share
6 answers

So, to answer my own question, the problem seems to be related to the latest version of javassist. We upgraded to the latest version as part of the latest update, 3.19.0, and it looks like it is not compatible with Tomcat on OpenShift. After I abandoned version 3.17.1, everything was in order.

As a note to any OpenShift staff, this would really help if such issues can be highlighted on the OpenShift support pages. Javassist 3.19.0 has been around maven for about 5 months, and I cannot imagine that we were the first to encounter this problem.

+6
source

This issue is confirmed in the Tomcat 7.0.56 changelog .

See this question for more information: Tomcat 7 Annotation scanner and JDK 8 with exceptions for compiler flag options

Javassist 3.19.0 uses java8 -parameters compiler argument

+4
source

In my project, I fixed this problem with exceptions:

It can help you.

  <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <version>5.1.0.Final</version> <exclusions> <exclusion> <groupId>org.javassist</groupId> <artifactId>javassist</artifactId> </exclusion> </exclusions> </dependency> 
+1
source

Considering this post " jar:jndi:/localhost/cope/WEB-INF/lib/javassist-3.19.0-GA.jar!/ "

There seems to be a problem with your classpath. Use relative path instead of absolute path. E.g. /lib/javassist-3.19.0-GA.jar

0
source

Find a dependency that requires org.javassist

mvn dependency:tree shows (e.g. spring-boot-starter-thymeleaf)

 [INFO] \- org.springframework.boot:spring-boot-starter-thymeleaf:jar:1.4.1.RELEASE:compile [INFO] +- org.thymeleaf:thymeleaf-spring4:jar:2.1.5.RELEASE:compile [INFO] | +- org.thymeleaf:thymeleaf:jar:2.1.5.RELEASE:compile [INFO] | | +- ognl:ognl:jar:3.0.8:compile [INFO] | | +- org.javassist:javassist:jar:3.20.0-GA:compile (version managed from 3.16.1-GA) [INFO] | | \- org.unbescape:unbescape:jar:1.1.0.RELEASE:compile [INFO] | \- org.slf4j:slf4j-api:jar:1.7.21:compile [INFO] \- nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:jar:1.4.0:compile [INFO] \- org.codehaus.groovy:groovy:jar:2.4.7:compile (version managed from 2.4.3) 

this dependency comes from the spring-boot-starter-thymeleaf excludes it and adds the dependency with the version supported in your environment

 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> <exclusions> <exclusion> <groupId>org.javassist</groupId> <artifactId>javassist</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.javassist</groupId> <artifactId>javassist</artifactId> <version>3.17.1-GA</version> </dependency> 

Check if this works well with the downgrade.

0
source

You can add banners to the scan. Just go to the file "catalina.properties" in the path nameRepository / .openshift / config / of your repository. And find the tomcat.util.scan.DefaultJarScanner.jarsToSkip section

At the end of this section, add the name of your jar, for example javassist-*.jar

0
source

All Articles