1

I just read about Multi-Release-Jars what looks like a good advantage. I can not get it working using a Tomcat8 on JDK10 and not getting a stacktrace.

This is my servlet (placed at webapp.jar!/META-INF/versions/10/de/NanoNanoServlet.class):

package de;
public class NanoNanoServlet extends HttpServlet {
  @SuppressWarnings("deprecation")
  @Override
  protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
      System.out.println("10");
  }
}

This is my servlet (placed at webapp.jar!/de/NanoNanoServlet.class):

package de;
public class NanoNanoServlet extends HttpServlet {
  @SuppressWarnings("deprecation")
  @Override
  protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
      System.out.println("Other");
  }
}

What I get is the console-output:

Other

But it must be

10

Using a Tomcat on JDK10

Grim
  • 1,938
  • 10
  • 56
  • 123
  • *I can not get it working using a Tomcat8 on JDK10 and not getting a stacktrace*...you forgot to mention what's not working or what's failing? – Naman Aug 22 '18 at 01:52
  • 1
    I assume the issue is that Tomcat is not using the new constructors to open JAR files as MR JARs. One thing you could try is to run with -Djdk.util.jar.enableMultiRelease=force to force it. – Alan Bateman Aug 26 '18 at 20:01

0 Answers0