You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by PJ Walstroem <wa...@hotmail.com> on 2012/11/02 14:23:57 UTC

Dependency to jaxb-impl

hello,
I see that camel-core, camel-jms and camel-spring transitively depends on
jaxb-impl. What would be the reason for that?

This causes some problems when using jax-ws. 

java.lang.ClassCastException: com.sun.xml.bind.v2.runtime.JAXBContextImpl
cannot be cast to com.sun.xml.internal.bind.api.JAXBRIContext at
com.sun.xml.internal.ws.fault.SOAPFaultBuilder

I had to do 
<exclusion>
 <groupId>com.sun.xml.bind</groupId> 
 <artifactId>jaxb-impl</artifactId>
</exclusion>

to prevent the ClassCastException

using Camel 2.10.2 and Java 1.7.0_07



--
View this message in context: http://camel.465427.n5.nabble.com/Dependency-to-jaxb-impl-tp5722030.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Dependency to jaxb-impl

Posted by PJ Walstroem <wa...@hotmail.com>.
great answer, thank you Dan.

/pj



--
View this message in context: http://camel.465427.n5.nabble.com/Dependency-to-jaxb-impl-tp5722030p5722036.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Dependency to jaxb-impl

Posted by Daniel Kulp <dk...@apache.org>.
On Nov 2, 2012, at 9:23 AM, PJ Walstroem <wa...@hotmail.com> wrote:

> hello,
> I see that camel-core, camel-jms and camel-spring transitively depends on
> jaxb-impl. What would be the reason for that?

There are a bunch of things we do that require a fully working and stable version of JAXB which is not something you really get if you completely depend on the version in the JDK.   The version in the JDK will depend completely on what version of the JDK you grab (1.7.0_01 vs 1.7.0_07 for example) with each having different bugs and such.

In addition, some of the new features that have been developed recently require the jaxb-impl, not the in-jdk version.  In particular, we added the ability to control the namespace prefixes and locations that are output when using the JAXB component.   That requires the jaxb-impl as all the package names are different for the in-jdk versions.

If you don't use the camel jaxb component/databindings and you can live with the bugs and issues from the in-jdk version, you can likely use the exclusion.   However, you may be better off with adding a more recent and stable JAX-WS implementation as a dependency (CXF 2.7.0 for example or even the latest RI: http://repo1.maven.org/maven2/com/sun/xml//ws/jaxws-rt/2.2.7/) which should be set to work correctly with the jaxb-impl dependency.

Dan



> This causes some problems when using jax-ws. 
> 
> java.lang.ClassCastException: com.sun.xml.bind.v2.runtime.JAXBContextImpl
> cannot be cast to com.sun.xml.internal.bind.api.JAXBRIContext at
> com.sun.xml.internal.ws.fault.SOAPFaultBuilder
> 
> I had to do 
> <exclusion>
> <groupId>com.sun.xml.bind</groupId> 
> <artifactId>jaxb-impl</artifactId>
> </exclusion>
> 
> to prevent the ClassCastException
> 
> using Camel 2.10.2 and Java 1.7.0_07
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/Dependency-to-jaxb-impl-tp5722030.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com