Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ContextFactory not found after upgrade to jaxb-runtime 3.0.0

Tags:

java

jaxb

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?

like image 538
Gert-Jan Avatar asked Oct 20 '25 02:10

Gert-Jan


1 Answers

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>
like image 137
aznan Avatar answered Oct 21 '25 17:10

aznan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!