camel-soap raise错误“不包含ObjectFactory.class或jaxb.in​​dex”

时间:2015-08-04 20:24:37

标签: apache-camel

我使用camel-soap生成soap请求,我使用cxf-codegen-plugin生成了我的客户端类。试图编组

SoapJaxbDataFormat soap = new SoapJaxbDataFormat("com.sample.test", new ServiceInterfaceStrategy(MyService.class, true));

......
from(direct:myFirstRoute).marshal(soap).to(direct:mySecondRoute).marshal(soap);

我有这个错误:

org.apache.camel.RuntimeCamelException: javax.xml.bind.JAXBException: "com.sample.test" doesnt contain ObjectFactory.class or jaxb.index

Caused by: javax.xml.bind.JAXBException: "com.sample.test" doesnt contain ObjectFactory.class or jaxb.index
    at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:281) [jaxb-impl-2.2.11.jar:2.2.11]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_80]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_80]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_80]
    at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_80]
    at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:137) [jboss-jaxb-api_2.2_spec-1.0.4.Final-redhat-2.jar:1.0.4.Final-redhat-2]
    at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:108) [jboss-jaxb-api_2.2_spec-1.0.4.Final-redhat-2.jar:1.0.4.Final-redhat-2]
    at javax.xml.bind.ContextFinder.find(ContextFinder.java:286) [jboss-jaxb-api_2.2_spec-1.0.4.Final-redhat-2.jar:1.0.4.Final-redhat-2]
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:412) [jboss-jaxb-api_2.2_spec-1.0.4.Final-redhat-2.jar:1.0.4.Final-redhat-2]
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:375) [jboss-jaxb-api_2.2_spec-1.0.4.Final-redhat-2.jar:1.0.4.Final-redhat-2]
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:279) [jboss-jaxb-api_2.2_spec-1.0.4.Final-redhat-2.jar:1.0.4.Final-redhat-2]
    at org.apache.camel.dataformat.soap.SoapJaxbDataFormat.createContext(SoapJaxbDataFormat.java:307) [camel-soap-2.15.2.jar:2.15.2]
    at org.apache.camel.converter.jaxb.JaxbDataFormat.doStart(JaxbDataFormat.java:366) [camel-jaxb-2.15.2.jar:2.15.2]
    at org.apache.camel.dataformat.soap.SoapJaxbDataFormat.doStart(SoapJaxbDataFormat.java:103) [camel-soap-2.15.2.jar:2.15.2]
    at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:74) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.processor.MarshalProcessor.doStart(MarshalProcessor.java:118) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:74) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:103) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:89) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:79) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:74) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:103) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:89) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.processor.RedeliveryErrorHandler.doStart(RedeliveryErrorHandler.java:1272) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.support.ChildServiceSupport.start(ChildServiceSupport.java:44) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.support.ChildServiceSupport.start(ChildServiceSupport.java:31) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:74) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:103) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:89) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.processor.interceptor.DefaultChannel.doStart(DefaultChannel.java:155) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:74) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:103) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:61) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:103) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:89) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.processor.MulticastProcessor.doStart(MulticastProcessor.java:1122) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:74) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:103) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:89) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:79) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:74) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.impl.RouteService.startChildService(RouteService.java:340) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.impl.RouteService.warmUp(RouteService.java:182) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:3090) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:3020) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:2797) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:2653) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:167) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2467) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2463) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2486) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:2463) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:2432) [camel-core-2.15.2.jar:2.15.2]
    at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:255) [camel-spring-2.15.2.jar:2.15.2]
    at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:121) [camel-spring-2.15.2.jar:2.15.2]

出现此错误的原因可能是什么? 在指定的包中也很好地生成了类(ObjectFactory)。

提前致谢。

0 个答案:

没有答案