1

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

MWiesner
  • 8,868
  • 11
  • 36
  • 70
Seyed Ali Roshan
  • 1,476
  • 1
  • 18
  • 37

1 Answers1

1

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"
Seyed Ali Roshan
  • 1,476
  • 1
  • 18
  • 37
  • could this be closed as a duplicate instead? – Naman Sep 24 '17 at 09:35
  • 1
    @nullpointer if you mean duplicate of https://stackoverflow.com/q/43574426/6442877, no. because it's about running tomcat and for solving it you should change tomcat catalina, which there isn't any reference to something like this in that link, so I think I used the solution in that question but they are different – Seyed Ali Roshan Oct 03 '17 at 07:52