0
votes

I'm trying to update the jax-impl class from version 1.0.6 to a more recent version in order to be compatible with jaxb-runtime:2.3.1 because of the following message:

java.lang.LinkageError: You are trying to run JAXB 2.0 runtime (from jar:file:/opt/tomcat/appName/WEB-INF/lib/jaxb-runtime-2.3.1.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) but you have old JAXB 1.0 runtime earlier in the classpath (at jar:file:/opt/tomcat/appName/WEB-INF/lib/jaxb-impl-1.0.6.jar!/com/sun/xml/bind/WhiteSpaceProcessor.class) Please remove the JAXB 1.0 runtime for 2.0 runtime to work correctly.

After increasing the version of jaxb-impl to any newer version, I get the following complaint:

java.lang.ClassNotFoundException: com.sun.xml.bind.ContextFactory_1_0_1

This occurs because of a call to the JAXBContext.newInstance method using a context path as an argument:

JAXBContext.newInstance('package.name')

newInstance calls using a class as an argument still work fine.

Is there a solution to the ClassNotFoundException: com.sun.xml.bind.ContextFactory_1_0_1 exception when upgrading Jaxb-Impl?

1

1 Answers

0
votes

I don't see com.sun.xml.bind.ContextFactory class in the jaxb-impl v2.3.1 jars. Are you missing a dependency?

It sounds like you should be calling: com.sun.xml.bind.v2.ContextFactory

Maybe you still have a dependency that is outdated and calling the old class.