javaapache-axisclassnotfoundexceptiontomcat9axiom

How to resolve ClassNotFoundException with specific Axis2 and Axiom combinations in Tomcat 9 and Java 11?


Hello StackOverflow community,

I'm having difficulties with my web project running on Apache Tomcat 9.0.62, using Java 11. My application uses the Axis2 (1.7.9) and Axiom (1.4.0) libraries for the creation and manipulation of web services.

During runtime, I'm encountering two ClassNotFoundException errors. Here are the full errors:

  1. java.lang.ClassNotFoundException: org.apache.axiom.soap.impl.builder.OMMetaFactoryEx
  2. java.lang.ClassNotFoundException: org.apache.axis.transport.http.AdminServlet

Full error:

SEVERE: Servlet.init() para servlet [AxisServlet] lanzó excepción
java.lang.ExceptionInInitializerError
    at org.apache.axis2.description.AxisDescription.<init>(AxisDescription.java:72)
    at org.apache.axis2.engine.AxisConfiguration.<init>(AxisConfiguration.java:175)
    at org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(DeploymentEngine.java:627)
    at org.apache.axis2.deployment.WarBasedAxisConfigurator.<init>(WarBasedAxisConfigurator.java:157)
    at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:620)
    at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:471)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1164)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1117)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1010)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4957)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5264)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
    at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
    at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:772)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476)
Caused by: java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/apache/axiom/soap/impl/builder/OMMetaFactoryEx
    at org.apache.axiom.om.OMAbstractFactory.<clinit>(OMAbstractFactory.java:116)
    ... 39 more
Caused by: java.lang.NoClassDefFoundError: org/apache/axiom/soap/impl/builder/OMMetaFactoryEx
    at java.base/java.lang.ClassLoader.defineClass1(Native Method)
    at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
    at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
    at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2489)
    at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:875)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1376)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1220)
    at java.base/java.lang.ClassLoader.defineClass1(Native Method)
    at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
    at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
    at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2489)
    at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:875)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1376)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1220)
    at org.apache.axiom.om.impl.dom.factory.OMDOMMetaFactoryLoader.load(OMDOMMetaFactoryLoader.java:28)
    at org.apache.axiom.locator.ImplementationFactory.parseImplementation(ImplementationFactory.java:142)
    at org.apache.axiom.locator.ImplementationFactory.parseDescriptor(ImplementationFactory.java:99)
    at org.apache.axiom.locator.DefaultOMMetaFactoryLocator.<init>(DefaultOMMetaFactoryLocator.java:87)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
    at org.apache.axiom.om.OMAbstractFactory.<clinit>(OMAbstractFactory.java:106)
    ... 39 more
Caused by: java.lang.ClassNotFoundException: org.apache.axiom.soap.impl.builder.OMMetaFactoryEx
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1412)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1220)
    ... 62 more

jul. 04, 2023 12:18:10 P. M. org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet [AxisServlet] in web application [/proyectWebService] threw load() exception
java.lang.ClassNotFoundException: org.apache.axiom.soap.impl.builder.OMMetaFactoryEx
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1412)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1220)
    at java.base/java.lang.ClassLoader.defineClass1(Native Method)
    at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
    at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
    at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2489)
    at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:875)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1376)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1220)
    at java.base/java.lang.ClassLoader.defineClass1(Native Method)
    at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
    at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
    at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2489)
    at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:875)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1376)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1220)
    at org.apache.axiom.om.impl.dom.factory.OMDOMMetaFactoryLoader.load(OMDOMMetaFactoryLoader.java:28)
    at org.apache.axiom.locator.ImplementationFactory.parseImplementation(ImplementationFactory.java:142)
    at org.apache.axiom.locator.ImplementationFactory.parseDescriptor(ImplementationFactory.java:99)
    at org.apache.axiom.locator.DefaultOMMetaFactoryLocator.<init>(DefaultOMMetaFactoryLocator.java:87)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
    at org.apache.axiom.om.OMAbstractFactory.<clinit>(OMAbstractFactory.java:106)
    at org.apache.axis2.description.AxisDescription.<init>(AxisDescription.java:72)
    at org.apache.axis2.engine.AxisConfiguration.<init>(AxisConfiguration.java:175)
    at org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(DeploymentEngine.java:627)
    at org.apache.axis2.deployment.WarBasedAxisConfigurator.<init>(WarBasedAxisConfigurator.java:157)
    at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:620)
    at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:471)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1164)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1117)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1010)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4957)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5264)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
    at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
    at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:772)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476)

jul. 04, 2023 12:18:10 P. M. org.apache.catalina.core.ApplicationContext log

I've experimented with various combinations of the Axis and Axiom libraries, from Axis 1.6 to Axiom 1.3. Based on my project requirements and compatibility, Axis 1.7.9 and Axiom 1.4.0 work best for me. Despite these efforts, and also attempting to add the JAR files manually both to the project and to the Tomcat server, the errors persist.

Here are the additional details of my setup:

My pom.xml

<properties>
    <axiom.version>1.4.0</axiom.version>
    <axis2.version>1.7.9</axis2.version>
</properties>
<dependency>
    <groupId>org.apache.axis2</groupId>
    <artifactId>axis2-kernel</artifactId>
    <version>${axis2.version}</version>
</dependency>
<dependency>
    <groupId>org.apache.axis2</groupId>
    <artifactId>axis2</artifactId>
    <version>${axis2.version}</version>
    <type>pom</type>
</dependency>
<dependency>
    <groupId>org.apache.axis2</groupId>
    <artifactId>axis2-transport-base</artifactId>
    <version>${axis2.version}</version>
</dependency>
<dependency>
    <groupId>org.apache.axis2</groupId>
    <artifactId>axis2-transport-local</artifactId>
    <version>${axis2.version}</version>
</dependency>
<dependency>
    <groupId>org.apache.axis2</groupId>
    <artifactId>axis2-transport-http</artifactId>
    <version>${axis2.version}</version>
</dependency>
<dependency>
    <groupId>org.apache.axis2</groupId>
    <artifactId>axis2-adb</artifactId>
    <version>${axis2.version}</version>
</dependency>
<dependency>
    <groupId>org.apache.ws.commons.axiom</groupId>
    <artifactId>axiom-api</artifactId>
    <version>${axiom.version}</version>
</dependency>
<dependency>
    <groupId>org.apache.ws.commons.axiom</groupId>
    <artifactId>axiom-impl</artifactId>
    <version>${axiom.version}</version>
</dependency>
<dependency>
    <groupId>org.apache.ws.commons.axiom</groupId>
    <artifactId>axiom-jaxb</artifactId>
    <version>${axiom.version}</version>
</dependency>
<dependency>
    <groupId>org.apache.ws.commons.axiom</groupId>
    <artifactId>axiom-dom</artifactId>
    <version>${axiom.version}</version>
</dependency>

Dependency tree

[INFO] --------------------< es.organization:proyect-ws >---------------------
[INFO] Building proyect-ws 1.0.0
[INFO] --------------------------------[ war ]---------------------------------
[WARNING] The artifact javax.xml:jaxrpc:jar:1.1 has been relocated to javax.xml:jaxrpc-api:jar:1.1
[WARNING] The artifact org.slf4j:slf4j-log4j12:jar:2.0.0 has been relocated to org.slf4j:slf4j-reload4j:jar:2.0.0
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ proyect-ws ---
[WARNING] The artifact javax.xml:jaxrpc:jar:1.1 has been relocated to javax.xml:jaxrpc-api:jar:1.1
[WARNING] The artifact org.slf4j:slf4j-log4j12:jar:2.0.0 has been relocated to org.slf4j:slf4j-reload4j:jar:2.0.0
[INFO] es.organization:proyect-ws:war:1.0.0
[INFO] +- org.apache.ws.commons.axiom:axiom-dom:jar:1.4.0:compile
[INFO] |  \- commons-logging:commons-logging:jar:1.2:compile
[INFO] +- org.apache.ws.commons.axiom:axiom-api:jar:1.4.0:compile
[INFO] |  +- jaxen:jaxen:jar:1.2.0:compile
[INFO] |  +- org.apache.james:apache-mime4j-core:jar:0.8.6:compile
[INFO] |  \- jakarta.activation:jakarta.activation-api:jar:1.2.2:compile
[INFO] +- org.apache.ws.commons.axiom:axiom-jaxb:jar:1.4.0:compile
[INFO] |  \- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.3:compile
[INFO] +- org.apache.axis2:axis2:pom:1.7.9:compile
[INFO] +- org.apache.axis2:axis2-adb:jar:1.7.9:compile
[INFO] |  +- org.apache.axis2:axis2-kernel:jar:1.7.9:compile
[INFO] |  |  +- org.apache.geronimo.specs:geronimo-ws-metadata_2.0_spec:jar:1.1.2:compile
[INFO] |  |  +- org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1:compile
[INFO] |  |  +- org.apache.woden:woden-core:jar:1.0M10:compile
[INFO] |  |  \- javax.ws.rs:jsr311-api:jar:1.1.1:compile
[INFO] |  \- org.apache.geronimo.specs:geronimo-activation_1.1_spec:jar:1.0.2:compile
[INFO] +- org.apache.axis2:axis2-adb-codegen:jar:1.7.9:compile
[INFO] |  +- org.apache.ws.xmlschema:xmlschema-core:jar:2.2.1:compile
[INFO] |  \- commons-cli:commons-cli:jar:1.2:compile
[INFO] +- org.apache.axis2:axis2-clustering:jar:1.7.9:compile
[INFO] |  +- org.apache.tomcat:tribes:jar:6.0.53:compile
[INFO] |  \- org.apache.tomcat:juli:jar:6.0.53:compile
[INFO] +- org.apache.axis2:axis2-codegen:jar:1.7.9:compile
[INFO] |  \- com.sun.xml.ws:jaxws-tools:jar:2.2.6:compile
[INFO] +- org.apache.axis2:axis2-corba:jar:1.7.9:compile
[INFO] |  +- antlr:antlr:jar:2.7.7:compile
[INFO] |  \- org.apache.axis2:axis2-metadata:jar:1.7.9:compile
[INFO] +- org.apache.axis2:axis2-fastinfoset:jar:1.7.9:compile
[INFO] |  +- com.sun.xml.fastinfoset:FastInfoset:jar:1.2.7:compile
[INFO] |  +- commons-httpclient:commons-httpclient:jar:3.1:compile
[INFO] |  +- commons-fileupload:commons-fileupload:jar:1.3.3:compile
[INFO] |  \- org.apache.neethi:neethi:jar:3.0.3:compile
[INFO] +- org.apache.axis2:axis2-java2wsdl:jar:1.7.9:compile
[INFO] +- org.apache.axis2:axis2-jaxbri:jar:1.7.9:compile
[INFO] |  +- com.sun.xml.bind:jaxb-impl:jar:2.2.6:compile
[INFO] |  +- com.sun.xml.bind:jaxb-xjc:jar:2.2.6:compile
[INFO] |  \- javax.xml.bind:jaxb-api:jar:2.2.6:compile
[INFO] +- org.apache.axis2:axis2-jaxws:jar:1.7.9:compile
[INFO] |  +- org.apache.geronimo.specs:geronimo-annotation_1.0_spec:jar:1.1:compile
[INFO] |  +- org.apache.geronimo.specs:geronimo-jaxws_2.2_spec:jar:1.0:compile
[INFO] |  +- org.apache.geronimo.specs:geronimo-javamail_1.4_spec:jar:1.6:compile
[INFO] |  +- xml-resolver:xml-resolver:jar:1.2:compile
[INFO] |  \- xalan:xalan:jar:2.7.0:compile
[INFO] +- org.apache.axis2:axis2-ant-plugin:jar:1.7.9:compile
[INFO] |  \- org.apache.ant:ant:jar:1.7.0:compile
[INFO] |     \- org.apache.ant:ant-launcher:jar:1.7.0:compile
[INFO] +- org.apache.axis2:axis2-json:jar:1.7.9:compile
[INFO] |  +- org.codehaus.jettison:jettison:jar:1.3.8:compile
[INFO] |  \- com.google.code.gson:gson:jar:2.1:compile
[INFO] +- org.apache.axis2:axis2-saaj:jar:1.7.9:compile
[INFO] |  \- org.apache.geronimo.specs:geronimo-saaj_1.3_spec:jar:1.0.1:compile
[INFO] +- xom:xom:jar:1.0:compile
[INFO] |  +- xerces:xercesImpl:jar:2.6.2:compile
[INFO] |  \- com.ibm.icu:icu4j:jar:2.6.1:compile
[INFO] +- org.apache.ws.commons.schema:XmlSchema:jar:1.4.7:compile
[INFO] +- xerces:xmlParserAPIs:jar:2.6.0:compile
[INFO] +- wsdl4j:wsdl4j:jar:1.6.2:compile
[INFO] +- com.fasterxml.woodstox:woodstox-core:jar:6.2.8:compile
[INFO] |  \- org.codehaus.woodstox:stax2-api:jar:4.2.1:compile
[INFO] +- jdom:jdom:jar:1.0:compile
[INFO] +- javax.xml:jaxrpc-api:jar:1.1:compile
[INFO] +- org.glassfish:javax.faces:jar:2.1.6:compile
[INFO] +- javax.el:javax.el-api:jar:2.2.1:compile
[INFO] +- org.apache.axis2:axis2-xmlbeans:jar:1.7.9:compile
[INFO] |  \- org.apache.xmlbeans:xmlbeans:jar:2.6.0:compile
[INFO] +- org.apache.axis2:axis2-transport-local:jar:1.7.9:compile
[INFO] +- org.apache.axis2:axis2-mtompolicy:jar:1.7.9:compile
[INFO] +- org.apache.axis2:axis2-transport-http:jar:1.7.9:compile
[INFO] |  \- org.apache.httpcomponents:httpclient:jar:4.5.3:compile
[INFO] |     \- org.apache.httpcomponents:httpcore:jar:4.4.6:compile
[INFO] +- javax.xml.soap:javax.xml.soap-api:jar:1.4.0:compile
[INFO] +- ca.uhn.hapi:hapi-base:jar:2.1:compile
[INFO] +- ca.uhn.hapi:hapi-structures-v25:jar:2.1:compile
[INFO] +- javax.validation:validation-api:jar:2.0.1.Final:compile
[INFO] +- org.hibernate:hibernate-entitymanager:jar:5.6.3.Final:compile
[INFO] |  +- org.jboss.logging:jboss-logging:jar:3.4.2.Final:compile
[INFO] |  +- org.hibernate.common:hibernate-commons-annotations:jar:5.1.2.Final:compile
[INFO] |  +- javax.persistence:javax.persistence-api:jar:2.2:compile
[INFO] |  +- net.bytebuddy:byte-buddy:jar:1.11.20:compile
[INFO] |  \- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:jar:1.1.1.Final:compile
[INFO] +- commons-codec:commons-codec:jar:1.15:compile
[INFO] +- org.bouncycastle:bcprov-jdk16:jar:1.46:compile
[INFO] +- commons-io:commons-io:jar:2.11.0:compile
[INFO] +- org.icefaces:icefaces-compat:jar:3.3.0:compile
[INFO] |  +- org.icefaces:icefaces:jar:3.3.0:compile
[INFO] |  +- commons-beanutils:commons-beanutils:jar:1.8.0:compile
[INFO] |  \- javax.servlet:jstl:jar:1.2:compile
[INFO] +- org.slf4j:slf4j-api:jar:1.7.32:compile
[INFO] +- ch.qos.logback:logback-classic:jar:1.2.5:compile
[INFO] |  \- ch.qos.logback:logback-core:jar:1.2.5:compile
[INFO] +- es.organization:proyect-neg:jar:1.0.0:compile
[INFO] |  +- es.organization:proyect-per:jar:1.0.0:compile
[INFO] |  +- javax.media.jai:com.springsource.javax.media.jai.core:jar:1.1.3:compile
[INFO] |  +- javax.media.jai:com.springsource.javax.media.jai.codec:jar:1.1.3:compile
[INFO] |  +- com.github.jai-imageio:jai-imageio-core:jar:1.4.0:compile
[INFO] |  +- org.apache.ws.commons.axiom:axiom-impl:jar:1.4.0:compile
[INFO] |  +- backport-util-concurrent:backport-util-concurrent:jar:3.1:compile
[INFO] |  +- org.apache.woden:woden-api:jar:1.0M9:compile
[INFO] |  +- ca.uhn.hapi:hapi-structures-v231:jar:2.3:compile
[INFO] |  \- org.dom4j:dom4j:jar:2.1.3:compile
[INFO] +- org.icefaces:icefaces-ace:jar:3.3.0:compile
[INFO] +- javax.annotation:jsr250-api:jar:1.0:provided
[INFO] +- javax.servlet:jsp-api:jar:2.0:provided
[INFO] +- javax.faces:jsf-impl:jar:1.2_13:provided
[INFO] +- javax.servlet:servlet-api:jar:2.5:provided
[INFO] +- org.icepush:icepush:jar:3.3.0:compile
[INFO] |  +- javax.servlet.jsp:jsp-api:jar:2.0:compile
[INFO] |  \- javax.mail:mail:jar:1.4.1:compile
[INFO] |     \- javax.activation:activation:jar:1.1:compile
[INFO] +- org.springframework:spring-core:jar:5.0.4.RELEASE:compile
[INFO] |  \- org.springframework:spring-jcl:jar:5.0.4.RELEASE:compile
[INFO] +- org.springframework:spring-web:jar:5.0.4.RELEASE:compile
[INFO] |  \- org.springframework:spring-beans:jar:5.0.4.RELEASE:compile
[INFO] +- org.springframework:spring-webmvc:jar:5.0.4.RELEASE:compile
[INFO] |  +- org.springframework:spring-aop:jar:5.0.4.RELEASE:compile
[INFO] |  +- org.springframework:spring-context:jar:5.0.4.RELEASE:compile
[INFO] |  \- org.springframework:spring-expression:jar:5.0.4.RELEASE:compile
[INFO] +- com.microsoft.sqlserver:sqljdbc4:jar:4.0:compile
[INFO] +- cglib:cglib:jar:2.1_3:compile
[INFO] |  \- asm:asm:jar:1.5.3:compile
[INFO] +- org.springframework.security:spring-security-core:jar:5.0.2.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-web:jar:5.0.2.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-config:jar:5.0.2.RELEASE:compile
[INFO] +- com.sun.faces:jsf-impl:jar:2.1.7:compile
[INFO] +- com.sun.faces:jsf-api:jar:2.1.7:compile
[INFO] +- org.springframework:spring-orm:jar:5.0.4.RELEASE:compile
[INFO] |  +- org.springframework:spring-jdbc:jar:5.0.4.RELEASE:compile
[INFO] |  \- org.springframework:spring-tx:jar:5.0.4.RELEASE:compile
[INFO] +- org.hibernate:hibernate-core:jar:5.6.3.Final:compile
[INFO] |  +- org.jboss:jandex:jar:2.2.3.Final:compile
[INFO] |  +- com.fasterxml:classmate:jar:1.5.1:compile
[INFO] |  +- javax.activation:javax.activation-api:jar:1.2.0:compile
[INFO] |  \- org.glassfish.jaxb:jaxb-runtime:jar:2.3.1:compile
[INFO] |     +- org.glassfish.jaxb:txw2:jar:2.3.1:compile
[INFO] |     +- com.sun.istack:istack-commons-runtime:jar:3.0.7:compile
[INFO] |     \- org.jvnet.staxex:stax-ex:jar:1.8:compile
[INFO] +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.2.Final:compile
[INFO] +- org.hibernate.validator:hibernate-validator:jar:7.0.1.Final:compile
[INFO] |  \- jakarta.validation:jakarta.validation-api:jar:3.0.0:compile
[INFO] +- com.oracle.database.jdbc:ojdbc10:jar:19.16.0.0:compile
[INFO] +- org.slf4j:slf4j-reload4j:jar:2.0.0:compile
[INFO] |  \- ch.qos.reload4j:reload4j:jar:1.2.19:compile
[INFO] +- commons-lang:commons-lang:jar:2.6:compile
[INFO] +- com.itextpdf:itextpdf:jar:5.5.0:compile
[INFO] +- commons-discovery:commons-discovery:jar:0.5:compile
[INFO] +- org.glassfish.web:el-impl:jar:2.2:compile
[INFO] |  \- javax.el:el-api:jar:2.2:compile
[INFO] \- net.sourceforge.jtds:jtds:jar:1.2.8:compile

Has anyone faced this issue before or have any idea on how to solve these ClassNotFoundException errors? Any suggestion is greatly appreciated.

Thanks in advance.


Solution

  • I was finally able to solve my problem, which was being affected by three key factors.

    1. Axis2 and Axiom Versions: I had to revert back to older versions of axis2 and axiom to avoid conflicts. The versions that finally worked for me are as follows:

      <axiom.version>1.2.13</axiom.version>
      <axis2.version>1.6.2</axis2.version>
      
    2. Library Load Order: The order in which libraries were loading in my project was also affecting things. Be sure to check and adjust this as needed in your own project.

    3. JDK 11 Incompatibilities: I also ran into an issue where javax.xml.stream was accessible by more than one module. To fix this, I had to exclude the following libraries from my dependencies:

      <dependency>
          <groupId>org.apache.ws.commons.axiom</groupId>
          <artifactId>axiom-api</artifactId>
          <version>${axiom.version}</version>
          <exclusions>
              <exclusion>
                  <groupId>org.apache.james</groupId>
                  <artifactId>apache-mime4j-core</artifactId>
              </exclusion>
              <exclusion>
                  <groupId>org.apache.geronimo.specs</groupId>
                  <artifactId>
                      geronimo-activation_1.1_spec
                  </artifactId>
              </exclusion>
              <exclusion>
                  <groupId>org.apache.geronimo.specs</groupId>
                  <artifactId>geronimo-stax-api_1.0_spec</artifactId>
              </exclusion>
          </exclusions>
      </dependency>
      
      <dependency>
          <groupId>org.apache.ws.commons.axiom</groupId>
          <artifactId>axiom-impl</artifactId>
          <version>${axiom.version}</version>
          <exclusions>
              <exclusion>
                  <groupId>org.apache.geronimo.specs</groupId>
                  <artifactId>
                      geronimo-activation_1.1_spec
                  </artifactId>
              </exclusion>
              <exclusion>
                  <groupId>org.apache.geronimo.specs</groupId>
                  <artifactId>geronimo-stax-api_1.0_spec</artifactId>
              </exclusion>
          </exclusions>
      </dependency>
      
      <dependency>
          <groupId>org.apache.ws.commons.axiom</groupId>
          <artifactId>axiom-dom</artifactId>
          <version>${axiom.version}</version>
          <exclusions>
              <exclusion>
                  <groupId>org.apache.geronimo.specs</groupId>
                  <artifactId>
                      geronimo-activation_1.1_spec
                  </artifactId>
              </exclusion>
          </exclusions>
      </dependency>
      
      <dependency>
          <groupId>org.apache.axis2</groupId>
          <artifactId>axis2-adb</artifactId>
          <version>${axis2.version}</version>
          <exclusions>
              <exclusion>
                  <groupId>org.apache.geronimo.specs</groupId>
                  <artifactId>
                      geronimo-activation_1.1_spec
                  </artifactId>
              </exclusion>
          </exclusions>
      </dependency>
      

    I hope this information can help someone else facing similar issues. Thanks to everyone for the help provided.