I have a project with dependency on JAXB:
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.2</version>
</dependency>
Upgrading to version 3.0.0 causes this error at runtime:
ClassNotFoundException: com.sun.xml.internal.bind.v2.ContextFactory
I noticed that the jaxb-runtime-3.0.0.jar contained a ContextFactory in a different package: org.glassfish.jaxb.runtime.v2
Is there some way to tell JAXB to use the other ContextFactory in org.glassfish.jaxb.runtime.v2?
Switching from glassfish to com.sun.xml.bind solved it for me.
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>3.0.0</version>
</dependency>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With