0

We are using ElasticSearch 6.8.2. Our application is written on Java. Previously we are using transport Client. It was working fine. But now we are upgrading to elasticsearch-rest-high-level-client. But after changing the code and removing all the compilation issues getting the following issue while deploying in embedded Jetty

com.google.inject.internal.util.$ComputationException: java.lang.ArrayIndexOutOfBoundsException: 19744
    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)
    at com.google.inject.internal.Errors.formatInjectionPoint(Errors.java:712)
    at com.google.inject.internal.Errors.formatSource(Errors.java:684)
    at com.google.inject.internal.Errors.format(Errors.java:555)
    at com.google.inject.CreationException.getMessage(CreationException.java:48)
    at java.lang.Throwable.getLocalizedMessage(Throwable.java:391)
    at java.lang.Throwable.toString(Throwable.java:480)
    at java.lang.String.valueOf(String.java:2994)
    at java.lang.StringBuilder.append(StringBuilder.java:131)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.setFailed(AbstractLifeCycle.java:204)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)
    at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:768)
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
    at org.eclipse.jetty.server.Server.doStart(Server.java:282)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at omaelisa.core.infrastructure.test.jetty.Jetty.start(Jetty.java:119)
    at omaelisa.core.infrastructure.test.jetty.StartApplication.start(StartApplication.java:78)
    at omaelisa.core.infrastructure.test.jetty.StartApplication.start(StartApplication.java:67)
    at omaelisa.ui.ya.CorporateApplicationStarter.main(CorporateApplicationStarter.java:24)
    at omaelisa.ui.ya.StartYa$StartYaWithTestContext.main(StartYa.java:177)
    at omaelisa.ui.ya.StartYa$StartYaWithTestContextWithPet3.main(StartYa.java:60)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 19744
    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)
    at com.google.inject.internal.util.$LineNumbers.<init>(LineNumbers.java:62)
    at com.google.inject.internal.util.$StackTraceElements$1.apply(StackTraceElements.java:36)
    at com.google.inject.internal.util.$StackTraceElements$1.apply(StackTraceElements.java:33)
    at com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:549)
    ... 28 more

We are using google guava 3.0. Please let me know how to resolve it.

  • Do you happen to have a minimal, reproducible example for us to look at? (https://stackoverflow.com/help/minimal-reproducible-example). If not, then in my experience, I find that creating one more allows me to more easily pinpoint what's going wrong. :) – jbduncan Nov 29 '19 at 19:06
  • As a side note, it looks like the version of Guava you're using is ancient by today's standards - it was released in 2010! By comparison, the current version is "28.1-jre". – jbduncan Nov 29 '19 at 19:23

1 Answers1

0

Eclipse Jetty 8 is EOL (End of Life).

Upgrade ASAP, as you are vulnerable to many things.

You have too old of a ASM jar.

Caused by: java.lang.ArrayIndexOutOfBoundsException: 19744
    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)

See prior answer for details https://stackoverflow.com/a/26496604/775715

Joakim Erdfelt
  • 46,896
  • 7
  • 86
  • 136
  • Yes I know. It is a legacy application so updating embedded Jetty to version 9 is a huge task. Any other solution will be very much helpful. Although while deploying in server we are using Jetty 9.3. Our Google Guice Version is 3.0. – Avinaba GHOSH HAJRA Dec 01 '19 at 22:09
  • we are using asm version 5.0.4 which is compatible with Java 8 as per the referred post. – Avinaba GHOSH HAJRA Dec 01 '19 at 22:19
  • You misunderstood, ASM version you choose needs to support the bytecode of your project and all of it's dependencies, not the runtime JVM you are running your project on. The error you have is due to having too old of an ASM JAR for your dependencies. – Joakim Erdfelt Dec 02 '19 at 12:59
  • In today's world, you have [Multi-Release JAR Files (JEP-238)](http://openjdk.java.net/jeps/238) which are jar files that can have higher bytecode then your runtime JVM. Check *all* of your dependencies for `META-INF/versions/` directory, those dependencies are Multi-Release JAR files. ([Only supported on Jetty 9.4.9 and newer](https://stackoverflow.com/a/50970415/775715)) – Joakim Erdfelt Dec 02 '19 at 13:04