使用jdk 9运行tomee 7.0.3

时间:2017-09-24 09:15:41

标签: java-ee java-9 tomee tomee-7

自从迁移到Oracle JDK 9后,我遇到了Tomee的问题。

我的tomee不会从这些错误消息开始:

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.

那我该怎么办?

顺便说一下,我把答案放在了

1 个答案:

答案 0 :(得分:1)

经过一番搜索后,我发现了https://stackoverflow.com/a/43574427/6442877

所以我通过在第287行的catalina.(sh/bat)中添加以下行来修复此问题

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