This error would look something like this in Eclipse IDE:It is because the JAXB library (Java Architecture for XML Binding) is missing in the classpath. JAXB is included in Java SE 10 or older, but it is removed from Java SE from Java 11 or newer –moved to Java EE under Jakarta EE project.That means if you encounter JAXBException error, it’s very much likely that you are using Java 11 or newer for your project – or at least the server is running under on that Java version. So to fix this error, you have to options:1. Use older Java version like JDK 8, 9 or 10 which still include the JAXB library by default. Or:2. Specify an additional dependency in your project’s pom.xml file as follows:
In case you don’t use Maven, you can manually download the JAXB JAR file from Maven repository, and add it to the project’s classpath:
Then restart the server, the error will go way.That's the solution to fix the error java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException.
About the Author:
Nam Ha Minh is certified Java programmer (SCJP and SCWCD). He began programming with Java back in the days of Java 1.4 and has been passionate about it ever since. You can connect with him on Facebook and watch his Java videos on YouTube.
To KJ: Convert your project to use Maven to take its advantages of dependency management so you will get rid of such issue. Reference: www.youtube.com/watch?v=kpJLWugEseY
I downloaded the JAR file and placed in a path in linux machine, added then path to the Linux CLASSPATH variable but still unable to compile. Please share your idea.
Comments