5

Running GWT app in the Superdev mode with the latest versions of Elasticsearch (above 6.1.1) creates the following error (see below). It is clear that the issue has to do with the outdated version of Jetty. Does anyone know how to replace Jetty in GWT or change the configuration in IntelliJ to use a different server? The instructions in GWT documentation are, in my opinion, poorly written. Ideally, of course, I wish there was a way to change Jetty directly in GWT so that all projects can use the updated version instead of configuring each project with its own server.

2018-06-20 16:17:13.923:INFO:oejs.Server:main: jetty-9.2.z-SNAPSHOT
Starting Jetty on port 8888
   [WARN] Failed startup of context c.g.g.d.s.j.WebAppContextWithReload@39f6694a{/,file:/Users/../Library/Caches/IntelliJIdea2018.1/gwt/....86a74491/....92536ba7/run/www/,STARTING}{/Users/../Library/Caches/IntelliJIdea2018.1/gwt/....86a74491/....92536ba7/run/www}
MultiException[java.lang.RuntimeException: Error scanning entry META-INF/versions/9/org/elasticsearch/core/internal/io/Streams.class from jar file:/Users/../Library/Caches/IntelliJIdea2018.1/gwt/.86a74491/.92536ba7/run/www/WEB-INF/lib/elasticsearch-core-6.3.0.jar, java.lang.RuntimeException: Error scanning entry META-INF/versions/9/org/elasticsearch/monitor/jvm/JvmPid.class from jar file:/Users/../Library/Caches/IntelliJIdea2018.1/gwt/...86a74491/.92536ba7/run/www/WEB-INF/lib/elasticsearch-6.3.0.jar]
    at org.eclipse.jetty.annotations.AnnotationConfiguration.scanForAnnotations(AnnotationConfiguration.java:536)
    at org.eclipse.jetty.annotations.AnnotationConfiguration.configure(AnnotationConfiguration.java:447)
    at org.eclipse.jetty.webapp.WebAppContext.configure(WebAppContext.java:479)
Joakim Erdfelt
  • 46,896
  • 7
  • 86
  • 136

1 Answers1

7

You have a JEP238 MultiRelease Jar File in your classpath.

Evidenced by the META-INF/versions/9/ prefixed entry.

JEP238 is a concept introduced with Java 9.

Jetty support for handling JEP238 MultiRelease JAR Files during bytecode scanning wasn't introduced until the Jetty 9.4.9.v20180320 (in March of 2018).

If you need to stay with Jetty 9.2.x then you'll have to not use JEP238 MultiRelease JAR Files.

If you must use JEP238 MultiRelease JAR Files, then you must upgrade to at least Jetty 9.4.9.v20180320.

Joakim Erdfelt
  • 46,896
  • 7
  • 86
  • 136
  • 1
    Although it is good to know why it is happening, the question was: Does anyone know how to replace Jetty in GWT or change the configuration in IntelliJ to use a different server? I got an answer to that question on GWT user group and will update the post here shortly. – user3302076 Jun 22 '18 at 20:07
  • @user3302076 > "...and will update the post here shortly." I know this is an old post but I just bumped into the very same issue trying to update our legacy application. Could you please post or reference the mentioned solution? – mmo Jul 28 '21 at 15:49