jakarta-eejava-9apache-tomeetomee-7

run tomee 7.0.3 with jdk 9


I have a problem with Tomee since I migrated to Oracle JDK 9.

my tomee won't start with these errors message:

Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
    at org.apache.openejb.config.ConfigurationFactory.<init>(ConfigurationFactory.java:222)
    at org.apache.openejb.config.ConfigurationFactory.<init>(ConfigurationFactory.java:177)
    at org.apache.openejb.config.ConfigurationFactory.<init>(ConfigurationFactory.java:158)
    at org.apache.tomee.catalina.TomcatWebAppBuilder.<init>(TomcatWebAppBuilder.java:331)
    at org.apache.tomee.catalina.TomcatLoader.initialize(TomcatLoader.java:212)
    at org.apache.tomee.catalina.ServerListener.lifecycleEvent(ServerListener.java:168)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
    at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:395)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:108)
    ... 8 more
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
    at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:466)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:563)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
    ... 17 more

24-Sep-2017 12:40:14.287 INFO [main] jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke Initialization processed in 1525 ms
24-Sep-2017 12:40:14.288 SEVERE [main] jdk.internal.reflect.NativeMethodAccessorImpl.invoke The required Server component failed to start so Tomcat is unable to start.

so what should I do?

by the way, I put the answer and should


Solution

  • After a little search, I found this https://stackoverflow.com/a/43574427/6442877

    so I fixed this problem by adding below line in catalina.(sh/bat) in line 287

    # Add ee modules
    JAVA_OPTS="$JAVA_OPTS --add-modules java.se.ee"