How does your routes look like?
What's about defining the dependency to camel-jaxb in both projects
(instead of jaxb-api and jaxb-impl)?

Best,
Christian

On Tue, May 1, 2012 at 7:24 PM, gehdan <g...@bizolution.de> wrote:

> Hi there,
>
> when using camel-jaxb 2.9.2 on Java 6 (1.6.0_32) I get this Exception:
>
> Exception in thread "main" java.lang.ClassCastException:
> com.xt_commerce.types.Order$JaxbAccessorF_orderId cannot be cast to
> com.sun.xml.bind.v2.runtime.reflect.Accessor
>        at
>
> com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.instanciate(OptimizedAccessorFactory.java:190)
>        at
>
> com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.get(OptimizedAccessorFactory.java:182)
>        at
>
> com.sun.xml.bind.v2.runtime.reflect.Accessor$FieldReflection.optimize(Accessor.java:279)
>        at
>
> com.sun.xml.bind.v2.runtime.property.SingleElementLeafProperty.<init>(SingleElementLeafProperty.java:82)
>        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
>        at
>
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>        at
>
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>        at
>
> com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:124)
>        at
>
> com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:179)
>        at
>
> com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:515)
>        at
>
> com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:330)
>        at
>
> com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1140)
>        at
> com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:154)
>        at
> com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:121)
>        at
> com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:202)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:597)
>        at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:128)
>        at javax.xml.bind.ContextFinder.find(ContextFinder.java:277)
>        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372)
>        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:337)
>        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:244)
>        at
>
> org.apache.camel.converter.jaxb.JaxbDataFormat.createContext(JaxbDataFormat.java:281)
>        at
>
> org.apache.camel.converter.jaxb.JaxbDataFormat.doStart(JaxbDataFormat.java:256)
>        at
> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:49)
>        at
>
> org.apache.camel.processor.MarshalProcessor.doStart(MarshalProcessor.java:92)
>        at
> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:49)
>        at
> org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:70)
>        at
>
> org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.start(AsyncProcessorConverterHelper.java:92)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:49)
>        at
> org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:70)
>        at
>
> org.apache.camel.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:78)
>        at
> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:49)
>        at
> org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:70)
>        at
>
> org.apache.camel.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:78)
>        at
>
> org.apache.camel.processor.interceptor.TraceInterceptor.doStart(TraceInterceptor.java:358)
>        at
> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:49)
>        at
> org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:70)
>        at
>
> org.apache.camel.processor.RedeliveryErrorHandler.doStart(RedeliveryErrorHandler.java:1044)
>        at
>
> org.apache.camel.support.ChildServiceSupport.start(ChildServiceSupport.java:41)
>        at
>
> org.apache.camel.support.ChildServiceSupport.start(ChildServiceSupport.java:28)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:49)
>        at
> org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:70)
>        at
>
> org.apache.camel.processor.interceptor.DefaultChannel.doStart(DefaultChannel.java:152)
>        at
> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:49)
>        at
> org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:82)
>        at
>
> org.apache.camel.processor.MulticastProcessor.doStart(MulticastProcessor.java:932)
>        at
> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:49)
>        at
> org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:82)
>        at
>
> org.apache.camel.processor.MulticastProcessor.doStart(MulticastProcessor.java:932)
>        at
> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:49)
>        at
> org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:70)
>        at
>
> org.apache.camel.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:78)
>        at
> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:49)
>        at
> org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:70)
>        at
>
> org.apache.camel.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:78)
>        at
>
> org.apache.camel.processor.interceptor.TraceInterceptor.doStart(TraceInterceptor.java:358)
>        at
> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:49)
>        at
> org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:70)
>        at
>
> org.apache.camel.processor.RedeliveryErrorHandler.doStart(RedeliveryErrorHandler.java:1044)
>        at
>
> org.apache.camel.support.ChildServiceSupport.start(ChildServiceSupport.java:41)
>        at
>
> org.apache.camel.support.ChildServiceSupport.start(ChildServiceSupport.java:28)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:49)
>        at
> org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:70)
>        at
>
> org.apache.camel.processor.interceptor.DefaultChannel.doStart(DefaultChannel.java:152)
>        at
> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:49)
>        at
> org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:82)
>        at
>
> org.apache.camel.processor.MulticastProcessor.doStart(MulticastProcessor.java:932)
>        at
> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:49)
>        at
> org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:70)
>        at
>
> org.apache.camel.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:78)
>        at
> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:49)
>        at
> org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:70)
>        at
>
> org.apache.camel.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:78)
>        at
>
> org.apache.camel.processor.UnitOfWorkProcessor.doStart(UnitOfWorkProcessor.java:88)
>        at
> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:49)
>        at
> org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:70)
>        at
>
> org.apache.camel.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:78)
>        at
> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:49)
>        at
> org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:70)
>        at
>
> org.apache.camel.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:78)
>        at
> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
>        at
> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59)
>        at
> org.apache.camel.impl.RouteService.startChildService(RouteService.java:315)
>        at org.apache.camel.impl.RouteService.warmUp(RouteService.java:151)
>        at
>
> org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:1925)
>        at
>
> org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:1853)
>        at
>
> org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:1646)
>        at
>
> org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1533)
>        at
>
> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1420)
>        at
> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
>        at
>
> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1388)
>        at de.bizolution.integration.datev_classic.Main.main(Main.java:72)
>
>
> Environment is as follows:
> Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
> Maven home: C:\Program Files\Apache Software Foundation\apache-maven-3.0.4
> Java version: 1.6.0_32, vendor: Sun Microsystems Inc.
> Java home: C:\Program Files\Java\jdk1.6.0_32\jre
> Default locale: de_DE, platform encoding: Cp1252
> OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"
>
> Eclipse Indigo SR2
>
> Project situation:
> A) maven-project that is using org.apache.cxf.cxf-codegen-plugin 2.5.2 to
> generate java classes from my custom WSDL
> B) maven-project that uses A and has s simple route fetching an order from
> a
> PHP webservice following that WSDL and writing the XML representation of
> that order in a file.
>
> Additional information:
> - the problem seems to occur when using multiple projects. If used in one
> project it seems to work
> - the reason for this type of exception seems to be the use of two
> different
> implementations of JAXB
> - I put the dependencies javax.xml.bind.jaxb-api 2.1 and
> com.sun.xml.bind.jaxb-impl 2.1.13 in the pom of project A, since these
> versions are used as dependencies of camel-jaxb 2.9.2. That didn't help.
> - Then I changed the version of jaxb-impl in that pom (project A) to
> 2.1.12.
> In project B maven now shows that 2.1.12 is used instead of 2.1.13 and
> marshalling now works. As soon as I change the version to 2.1.13 in project
> A, I get the afore mentioned exception again.
>
> Is that a bug in camel 2.9.2 or some maven dependency problem? Any ideas
> how
> to resolve that issue without using 2.1.12 (I'm new to both camel and
> maven)?
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/JAXB-classpath-issue-with-camel-jaxb-2-9-2-tp5678527.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Reply via email to