close

[Solved] java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException

Hello Guys, How are you all? Hope You all Are Fine. Today I am just starting Apache Tomcat server But I am facing following error java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException 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 This Error Occurs ?

I am just starting Apache Tomcat server But I am facing following error.

java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException......
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException

How To Solve java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException Error ?

  1. How To Solve java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException Error ?

    To Solve java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException Error If you are using jdk 9 or a later version then just add this dependency to your pom.xml
    <dependency> <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api</artifactId> <version>2.3.0</version> </dependency> and My error solved successfully.

  2. java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException

    To Solve java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException Error If you are using jdk 9 or a later version then just add this dependency to your pom.xml
    <dependency> <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api</artifactId> <version>2.3.0</version> </dependency> and My error solved successfully.

Solution 1: add this dependency in pom.xml

Just need to add this dependency in pom.xml.

<dependency>
    <groupId>javax.xml.bind</groupId>
    <artifactId>jaxb-api</artifactId>
    <version>2.3.1</version>
</dependency>

Solution 2: need is to specify this list of dependencies

Just need is to specify this list of dependencies.

<dependencies>
    <dependency>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
        <version>2.3.0</version>
    </dependency>
    <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-impl</artifactId>
        <version>2.3.0</version>
    </dependency>
    <dependency>
        <groupId>org.glassfish.jaxb</groupId>
        <artifactId>jaxb-runtime</artifactId>
        <version>2.3.0</version>
    </dependency>
    <dependency>
        <groupId>javax.activation</groupId>
        <artifactId>activation</artifactId>
        <version>1.1.1</version>
    </dependency>
</dependencies>

Solution 3: For jdk 9 or a later version

If you are using jdk 9 or a later version then just add this dependency to your pom.xml

<dependency>
  <groupId>javax.xml.bind</groupId>
  <artifactId>jaxb-api</artifactId>
  <version>2.3.0</version>
</dependency>

and My error solved successfully.

Summary

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?

Also, Read

Leave a Comment