1

I am trying to run another Tomcat instance on the same server. When I deploy application (Maven, Java 8, Guice 3.0, Jersey 1.19) on the first Tomcat 7, it startups and runs well. However, the same application in another Tomcat 7 does not startup properly:

java.util.logging.ErrorManager: 5
com.google.inject.internal.util.$ComputationException: java.lang.ArrayIndexOutOfBoundsException: 57912
    at com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:553)
    at com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:419)
    at com.google.inject.internal.util.$CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)
    at com.google.inject.internal.util.$StackTraceElements.forMember(StackTraceElements.java:53)

...

Caused by: java.lang.ArrayIndexOutOfBoundsException: 57912
    at com.google.inject.internal.asm.$ClassReader.<init>(Unknown Source)
    at com.google.inject.internal.asm.$ClassReader.<init>(Unknown Source)
    at com.google.inject.internal.asm.$ClassReader.<init>(Unknown Source)

I have tried on Why is a lambda expression breaking guice error handling when i try to start jetty? discussion answer and switched from Guice 3 to 4 but it didn't change anything.

How to solve this problem?

Community
  • 1
  • 1
Justinas Jakavonis
  • 8,220
  • 10
  • 69
  • 114
  • 1
    Is java version the same in both tomcats? I remember some issues regarding Array Sorting Order or something like this in Java7 -> Java8, so some applications failed to start (SoapUI among of them). – lospejos Oct 12 '16 at 08:50
  • When I execute ./catalina.sh version in both folders, I get the same - JVM Version: 1.8.0_91-b14 – Justinas Jakavonis Oct 12 '16 at 08:53
  • It works after commenting lambda expressions in the app. However, I forgot that I have included library which use Guice 3. So after updating it to Guice 4, Tomcat started up. – Justinas Jakavonis Oct 12 '16 at 11:09
  • Suppose you can specify your last comment as a solution to this question :-) – lospejos Oct 12 '16 at 12:37

1 Answers1

2

It works after commenting lambda expressions in the app. However, I forgot that I have included .jar library which also use Guice 3 so after updating it to Guice 4, Tomcat started up:

<dependency>
    <groupId>com.google.inject</groupId>
    <artifactId>guice</artifactId>
    <version>4.1.0</version>
</dependency>
Justinas Jakavonis
  • 8,220
  • 10
  • 69
  • 114