Skip to main content

Running JAXB 1.0 application with JAXB 2.1.2 Libs failed

1 reply [Last post]
Joined: 2007-04-27

Hello JAXB Developers and Users,

I'd like to run my old JAXB 1.x applications on the JAXB 2.0 runtime.
The applications are using the default context implementation class: defined in the
Running this applications using the jaxb 2.1.12 jars including the jaxb1-impl.jar an ClassNotFoundException will be thrown.
The DefaultJAXBContextImpl is not in the classpath.
Does anybody knows a solution to run my old JAXB1.x applications side by side with my JAXB 2.x applications?

Thanks in advance.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2006-01-27

Hi all,

I have the same problem.

I have existing jaxb 1.0 classes (generated by 1.0 xjc).

Try to run them with a standalone program (no appserver) or junit 4.

Got this exception:

com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions

com.sun.xml.bind.DefaultJAXBContextImpl does not have a no-arg default constructor.

this problem is related to the following location:

at com.sun.xml.bind.DefaultJAXBContextImpl


at com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException$Builder.check(

at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(

at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(

at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl$

at com.sun.xml.internal.bind.v2.ContextFactory.createContext(

at com.sun.xml.internal.bind.v2.ContextFactory.createContext(

at com.sun.xml.internal.bind.v2.ContextFactory.createContext(

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(

at sun.reflect.DelegatingMethodAccessorImpl.invoke(

at java.lang.reflect.Method.invoke(

at javax.xml.bind.ContextFinder.newInstance(

at javax.xml.bind.ContextFinder.find(

at javax.xml.bind.JAXBContext.newInstance(

at javax.xml.bind.JAXBContext.newInstance(

at javax.xml.bind.JAXBContext.newInstance(

at com.mamama.api.client.RestTemplate.getForObject(

at com.mamama.api.client.RestTemplate.main(

Convention wisdom is just to put jaxb1-impl.jar into the classpath. Doesn't work.

Somehow weblogic does not have the same complain. Couldn't figure out how weblogic do it. But I want my junit environment working first...

Any hints would be appreciated.