I am migrating a Java Application to OpenJDK11 which is running on Tomcat 8.5. Application and tomcat starts withount any problem. With JDK1.8 I don't have any exception or error But when calling application with another Webservice and running tomcat with OpenJDK11 I get following error:
02-Apr-2019 13:27:07.225 SEVERE [http-nio-0.0.0.0-9000-exec-8] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [CXFServlet] in context with path [/ApplicationName] threw exception [Servlet execution threw an exception] with root cause
java.lang.NoClassDefFoundError: Could not initialize class org.apache.cxf.attachment.AttachmentUtil
at org.apache.cxf.interceptor.AttachmentInInterceptor.handleMessage(AttachmentInInterceptor.java:55)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:267)
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:216)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:301)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:220)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:276)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:613)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1468)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:834)
When I open Eclipse workspace for this application I can also open and see AttachmentUtil class. This class is in jar 'cxf-core-3.3.1' included which depends on ' org.apache.cxf:cxf-rt-frontend-jaxws:jar:3.3.1:'
This is my mvn dependeny tree:
--- maven-dependency-plugin:2.8:tree (default-cli) @ XmlBeans ---
de.somename.rail.sresb.entireXComServer:XmlBeans:jar:2.12.1
+- org.apache.cxf:cxf-rt-frontend-jaxws:jar:3.3.1:compile
| +- xml-resolver:xml-resolver:jar:1.2:compile
| +- org.ow2.asm:asm:jar:7.0:compile
| +- org.apache.cxf:cxf-core:jar:3.3.1:compile
| | +- com.fasterxml.woodstox:woodstox-core:jar:5.0.3:compile
| | +- org.apache.ws.xmlschema:xmlschema-core:jar:2.2.4:compile
| | +- org.glassfish.jaxb:jaxb-xjc:jar:2.3.2:compile
| | | +- org.glassfish.jaxb:xsom:jar:2.3.2:compile
| | | +- org.glassfish.jaxb:codemodel:jar:2.3.2:compile
| | | +- com.sun.xml.bind.external:rngom:jar:2.3.2:compile
| | | +- com.sun.xml.dtd-parser:dtd-parser:jar:1.4.1:compile
| | | +- com.sun.istack:istack-commons-tools:jar:3.0.8:compile
| | | | \- org.apache.ant:ant:jar:1.10.5:compile
| | | | \- org.apache.ant:ant-launcher:jar:1.10.5:compile
| | | \- com.sun.xml.bind.external:relaxng-datatype:jar:2.3.2:compile
| | \- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.2:compile
| | \- jakarta.activation:jakarta.activation-api:jar:1.2.1:compile
| +- org.apache.cxf:cxf-rt-bindings-soap:jar:3.3.1:compile
| | +- org.apache.cxf:cxf-rt-wsdl:jar:3.3.1:compile
| | | \- wsdl4j:wsdl4j:jar:1.6.3:compile
| | \- org.apache.cxf:cxf-rt-databinding-jaxb:jar:3.3.1:compile
| +- org.apache.cxf:cxf-rt-bindings-xml:jar:3.3.1:compile
| +- org.apache.cxf:cxf-rt-frontend-simple:jar:3.3.1:compile
| +- org.apache.cxf:cxf-rt-ws-addr:jar:3.3.1:compile
| | \- org.apache.cxf:cxf-rt-ws-policy:jar:3.3.1:compile
| | \- org.apache.neethi:neethi:jar:3.1.1:compile
| +- javax.annotation:javax.annotation-api:jar:1.3.1:compile
| +- com.sun.activation:javax.activation:jar:1.2.0:compile
| +- org.apache.geronimo.specs:geronimo-ws-metadata_2.0_spec:jar:1.1.3:compile
| +- com.sun.xml.messaging.saaj:saaj-impl:jar:1.4.0-b03:compile
| +- org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1.1:compile
| \- org.jboss.spec.javax.rmi:jboss-rmi-api_1.0_spec:jar:1.0.6.Final:compile
+- javax.xml.bind:jaxb-api:jar:2.3.0:compile
+- org.glassfish.main.javaee-api:javax.jws:jar:3.1.2.2:compile
+- javax.xml.ws:jaxws-api:jar:2.3.1:compile
| \- javax.xml.soap:javax.xml.soap-api:jar:1.4.0:compile
+- javax.activation:javax.activation-api:jar:1.2.0:compile
+- org.glassfish.jaxb:jaxb-runtime:jar:2.3.1:compile
| +- org.glassfish.jaxb:txw2:jar:2.3.1:compile
| +- com.sun.istack:istack-commons-runtime:jar:3.0.7:compile
| +- org.jvnet.staxex:stax-ex:jar:1.8:compile
| \- com.sun.xml.fastinfoset:FastInfoset:jar:1.2.15:compile
+- com.sun.xml.bind:jaxb-core:jar:2.3.0:compile
+- com.sun.xml.bind:jaxb-impl:jar:2.3.0:compile
+- com.sun.xml.ws:rt:jar:2.3.0:compile
| +- com.sun.xml.ws:policy:jar:2.7.2:compile
| +- org.glassfish.gmbal:gmbal-api-only:jar:3.1.0-b001:compile
| | \- org.glassfish.external:management-api:jar:3.0.0-b012:compile
| +- com.sun.xml.stream.buffer:streambuffer:jar:1.5.4:compile
| +- org.jvnet.mimepull:mimepull:jar:1.9.7:compile
| +- org.codehaus.woodstox:woodstox-core-asl:jar:4.4.1:compile
| +- org.codehaus.woodstox:stax2-api:jar:3.1.4:compile
| +- com.sun.org.apache.xml.internal:resolver:jar:20050927:compile
| \- javax.jws:jsr181-api:jar:1.0-MR1:compile
\- com.sun.xml.ws:jaxws-rt:jar:2.3.0:compile
Any useful hints are appreciated. Thx in advance.