close

[Solved] java.lang.NoClassDefFoundError : javax/xml/soap/SOAPException

Hello Guys, How are you all? Hope You all Are Fine. Today I am facing the following error java.lang.NoClassDefFoundError : javax/xml/soap/SOAPException in Java. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How java.lang.NoClassDefFoundError : javax/xml/soap/SOAPException Error Occurs?

Today I am facing the following error java.lang.NoClassDefFoundError : javax/xml/soap/SOAPException in Java.

How To Solve java.lang.NoClassDefFoundError : javax/xml/soap/SOAPException Error ?

  1. How To Solve java.lang.NoClassDefFoundError : javax/xml/soap/SOAPException Error ?

    To Solve java.lang.NoClassDefFoundError : javax/xml/soap/SOAPException Error Yes, In Java 11 java.xml.soap was completely removed. java.lang.NoClassDefFoundError: javax/xml/soap/SOAPException can be removed by adding the following dependency.

  2. java.lang.NoClassDefFoundError : javax/xml/soap/SOAPException

    To Solve java.lang.NoClassDefFoundError : javax/xml/soap/SOAPException Error Yes, In Java 11 java.xml.soap was completely removed. java.lang.NoClassDefFoundError: javax/xml/soap/SOAPException can be removed by adding the following dependency.

Solution 1

Adding the following in pom file solved the issue

<!-- https://mvnrepository.com/artifact/javax.xml.soap/javax.xml.soap-api -->
<dependency>
    <groupId>javax.xml.soap</groupId>
    <artifactId>javax.xml.soap-api</artifactId>
    <version>1.4.0</version>
</dependency>

Solution 2

Yes, In Java 11 java.xml.soap was completely removed. java.lang.NoClassDefFoundError: javax/xml/soap/SOAPException can be removed by adding the following dependency.

<dependency>
    <groupId>jakarta.xml.soap</groupId>
    <artifactId>jakarta.xml.soap-api</artifactId>
    <version>2.0.0-RC3</version>
</dependency>

But later, you will encounter , javax.xml.soap.SOAPException: Unable to create SAAJ meta-factory: Provider com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl not found. This can be solved by adding the following dependency.

<dependency>
    <groupId>com.sun.xml.messaging.saaj</groupId>
    <artifactId>saaj-impl</artifactId>
    <version>1.5.1</version>
</dependency>

Hope, it helps!

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read