Linked Questions

1250 votes
46 answers
1.5m views

How to resolve java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException

I have some code that uses JAXB API classes which have been provided as a part of the JDK in Java 6/7/8. When I run the same code with Java 9, at runtime I get errors indicating that JAXB classes can ...
Andy Guibert's user avatar
  • 42.2k
295 votes
11 answers
159k views

Replacements for deprecated JPMS modules with Java EE APIs

Java 9 deprecated six modules that contain Java EE APIs and they are going to be removed soon: java.activation with javax.activation package java.corba with javax.activity, javax.rmi, javax.rmi.CORBA,...
Nicolai Parlog's user avatar
35 votes
10 answers
73k views

Maven not picking JAVA_HOME correctly

I am on windows environment and using maven to compile my project. Although I just created the project and added the dependencies for various libararies. As I added them maven started complaining for ...
Garry's user avatar
  • 4,543
32 votes
1 answer
26k views

What is the difference between jaxb-impl and jaxb-runtime?

Clearly the com.sun.xml.bind:jaxb-impl artifact is labelled "Old JAXB Runtime module" in the maven repository (see link below), and yet both of these artifacts are still getting new releases:...
swpalmer's user avatar
  • 4,093
29 votes
8 answers
71k views

How to generate jaxb classes from xsd using gradle, jaxb and xjc, classes should have XmlRootElement

We were trying to generate JAXB classes using gradle, xsd and xjc, and JAXB classes should have XmlRootElement annotations so it could be used to expose as web service reponse. We were following this ...
Aamir's user avatar
  • 705
26 votes
4 answers
58k views

Define Spring JAXB namespaces without using NamespacePrefixMapper

[Heavily edited as understanding progresses] Is it possible to get Spring Jaxb2Marshaller to use a custom set of namespace prefixes (or at least respect the ones given in the schema file/annotations) ...
Gary's user avatar
  • 7,207
25 votes
2 answers
19k views

Why has AnnotationReader been removed from JAXB reference implementation?

The class com.sun.xml.bind.v2.model.annotation.AnnotationReader was part of jaxb-impl 2.1.6, but has been removed in 2.1.7. Does anybody know why?
Stefan Birkner's user avatar
23 votes
5 answers
23k views

How does one get JAXB-generated sources onto the Eclipse build path under m2e/Indigo?

Under Helios/m2eclipse, when I generated jaxb sources they would be put on the Eclipse source path when I did an "Update Project Configuration". This doesn't happen with Indigo/m2e (initial release ...
Ed Staub's user avatar
  • 15.6k
20 votes
1 answer
4k views

What is the difference between jaxb-core and jaxb-impl

Under what scenario i need to choose between jaxb-impl vs jaxb-core? having both jaxb-impl and jaxb-core in my project would cause any class loading conflicts?
Shravan Ramamurthy's user avatar
6 votes
3 answers
4k views

How do you invoke schemagen in Java 11?

According to Oracle documentation the schemagen tool is removed from the JDK as part of JEP 320 (http://openjdk.java.net/jeps/320). That JEP points to Maven artifacts that now supply the missing tools....
swpalmer's user avatar
  • 4,093
4 votes
4 answers
5k views

JAXB doesn't unmarshall after updating java from 1.8.0_77 to 1.8.0_121

Yesterday I updated java like posted in the title, now JAXB doesn't parse xml anymore. All objects are simply null, nothing seems to be set. Given this POJO - ListMatchingProductsResponse @...
baao's user avatar
  • 72.6k
3 votes
2 answers
493 views

JAXB how to remove anything from JDefinedClass

i am using jaxb to generate code from an xsd. The generated code contains a lot of annotations; for classes and fields. I am trying to use com.sun.tools.internal.xjc.Plugin to modify the generated ...
weima's user avatar
  • 4,762
3 votes
0 answers
3k views

difference between com.sun.xml.bind jaxb-impl.jar and javax.xml jaxb-impl.jar

What is the difference between jaxb-impl.jar with maven groupId javax.xml and a jaxb-impl.jar with maven groupId com.sun.xml.bind?
pranav's user avatar
  • 163
1 vote
2 answers
14k views

Using ant XJC in gradle to compile multiple XSDs from JAR

So I am able to generate classes from ONE xsd in the contract jar, using ant xjc. How can I generate classes from multiple schemas from this jar without unpacking it ant.xjc(package: packageName, ...
arseniyandru's user avatar
0 votes
1 answer
732 views

Spring Boot 2 project works in IDE but not command line

I am running a Spring Boot project. I can run the project from IntelliJ, however when I try and do mvn spring-boot:run I get java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException I have ...
MaxPower's user avatar
  • 871