Quantcast

JAXB classpath issue with camel-jaxb 2.9.2

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

JAXB classpath issue with camel-jaxb 2.9.2

gehdan
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)?
--
Daniel Geh
BIZOLUTION GmbH
Web: http://www.bizolution.de
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: JAXB classpath issue with camel-jaxb 2.9.2

Christian Mueller
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 <[hidden email]> 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 | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

AW: JAXB classpath issue with camel-jaxb 2.9.2

gehdan
This post has NOT been accepted by the mailing list yet.

Hi Christian,

 

my route looks like this:

VeytonProxy proxy = new VeytonProxy(

new URL("" target="_top" rel="nofollow" link="external">click here.

NAML

--
Daniel Geh
BIZOLUTION GmbH
Web: http://www.bizolution.de
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: AW: JAXB classpath issue with camel-jaxb 2.9.2

gehdan
gah.. damn HTML mails... sorry for that, I'm trying again:

my route looks like this:
VeytonProxy proxy = new VeytonProxy(
new URL("http://shop.example.com/index.php?page=soap_api_wsdl"));


JaxbDataFormat d = new JaxbDataFormat(); d.setDataFormatName("jaxb"); d.setContextPath("com.xt_commerce.types");
d.setPartClass("com.xt_commerce.types.Order");
d.setPartNamespace("{http://www.xt-commerce.com/types}order");
d.setPrettyPrint(true);
from("timer://fetchOrderTimer?period=5000")
.setBody(simple("1"))
       .bean(proxy, "getOrderIds")
       .split(body(String[].class))
       .log("fetching order '${body}' from shop.")
       .bean(proxy, "getOrder")
       .setHeader("identifier", simple("order-${body.orderId}-${body.customerId}"))
       .log("order '${body.orderId}' successfully loaded, customer: ${body.customerId}")
       .marshal(d)
       .to("file://c:/temp?fileName=${header[identifier]}.txt");

Using camel-jaxb instead of jaxb-* as dependency in both projects doesn't help - as expected. Since I already used the versions of jaxb-* that were defined as dependency of camel-jaxb.

This seems to be a problem of version 2.1.13 of jaxb-impl.

Thanks,
Daniel
--
Daniel Geh
BIZOLUTION GmbH
Web: http://www.bizolution.de
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: AW: JAXB classpath issue with camel-jaxb 2.9.2

Christian Mueller
It looks like you are using
org.apache.camel.model.dataformat.JaxbDataFormat and not
org.apache.camel.converter.jaxb.JaxbDataFormat.

I added a test which shows that marshalling partial classes works in
generall:
https://svn.apache.org/repos/asf/camel/trunk/components/camel-jaxb/src/test/java/org/apache/camel/converter/jaxb/JaxbDataFormatPartClassTest.java

Best,
Christian

On Fri, May 4, 2012 at 5:11 PM, gehdan <[hidden email]> wrote:

> gah.. damn HTML mails... sorry for that, I'm trying again:
>
> my route looks like this:
> VeytonProxy proxy = new VeytonProxy(
> new URL("http://shop.example.com/index.php?page=soap_api_wsdl"));
>
>
> JaxbDataFormat d = new JaxbDataFormat(); d.setDataFormatName("jaxb");
> d.setContextPath("com.xt_commerce.types");
> d.setPartClass("com.xt_commerce.types.Order");
> d.setPartNamespace("{http://www.xt-commerce.com/types}order");
> d.setPrettyPrint(true);
> from("timer://fetchOrderTimer?period=5000")
> .setBody(simple("1"))
>       .bean(proxy, "getOrderIds")
>       .split(body(String[].class))
>       .log("fetching order '${body}' from shop.")
>       .bean(proxy, "getOrder")
>       .setHeader("identifier",
> simple("order-${body.orderId}-${body.customerId}"))
>       .log("order '${body.orderId}' successfully loaded, customer:
> ${body.customerId}")
>       .marshal(d)
>       .to("file://c:/temp?fileName=${header[identifier]}.txt");
>
> Using camel-jaxb instead of jaxb-* as dependency in both projects doesn't
> help - as expected. Since I already used the versions of jaxb-* that were
> defined as dependency of camel-jaxb.
>
> This seems to be a problem of version 2.1.13 of jaxb-impl.
>
> Thanks,
> Daniel
>
> -----
> --
> Daniel Geh
> BIZOLUTION GmbH
> Web: http://www.bizolution.de
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/JAXB-classpath-issue-with-camel-jaxb-2-9-2-tp5678527p5686166.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
Loading...