camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: CXF Webservice in Camel
Date Tue, 10 May 2011 08:40:37 GMT
Hi,

Did you generate the DataService artifacts from WSDL?
If not, you may need to add the ObjectFactory.class or jaxb.index file 
to help the JAXB to create a right context for you.

Willem

On 5/10/11 7:41 PM, Chris Richmond wrote:
>
> Listed below is a simple isolated class which attempts to serve up my
> JAX-WS service at the appropriate url and has and implementation class
> which handles requests to it(DataService and DataServiceImpl,
> respectively). These two classes work just fine running a pure CXF
> implementation without camel.
>
> Below the code is the exception I am getting when starting up. Any ideas
> why JAXB suddenly needs more artifacts?
>
>
>
> public class CamelTestMain {
>
> private static final String WEB_SERVICES_URL =
> "cxf://http://qtmpc:9999/LiveActionDataService?dataFormat=PAYLOAD&wsdlURL=DataService.wsdl&serviceName={http://my.name.space}DataService&serviceClass=com.cameltest.DataService";
>
>
> /**
> * @param args
> */
> public static void main(String[] args) {
> // TODO Auto-generated method stub
>
>
> CamelContext context = new DefaultCamelContext();
> try {
> context.addRoutes(new RouteBuilder() {
> public void configure() {
>
>
> SoapJaxbDataFormat soapDF = new
> SoapJaxbDataFormat("com.cameltest.DataService", new
> ServiceInterfaceStrategy(DataService.class, false));
> DataService serverBean = new DataServiceImpl();
>
>
> from(WEB_SERVICES_URL)
> .onException(Exception.class)
> .handled(true)
> .marshal(soapDF)
> .end()
> .unmarshal(soapDF)
> .bean(serverBean)
> .marshal(soapDF);
>
>
> }
> });
>
> context.start();
> Thread.sleep(10000000);
> context.stop();
> } catch (Exception e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
>
>
>
> }
>
> }
> --------------------------------------------------------------------
>
> javax.xml.bind.JAXBException: "com..cameltest.DataService" doesnt
> contain ObjectFactory.class or jaxb.index
> at
> com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:197)
> 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.dataformat.soap.SoapJaxbDataFormat.createContext(SoapJaxbDataFormat.java:336)
>
> at
> org.apache.camel.converter.jaxb.JaxbDataFormat.doStart(JaxbDataFormat.java:251)
>
> at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
> at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
> at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:60)
> at
> org.apache.camel.processor.MarshalProcessor.doStart(MarshalProcessor.java:85)
>
> at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
> at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
> at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:60)
> at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:74)
> at
> org.apache.camel.processor.DelegateProcessor.doStart(DelegateProcessor.java:76)
>
> at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
> at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
> at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:60)
> at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:74)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:77)
>
> at
> org.apache.camel.processor.interceptor.TraceInterceptor.doStart(TraceInterceptor.java:434)
>
> at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
> at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
> at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:60)
> at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:74)
> at
> org.apache.camel.processor.RedeliveryErrorHandler.doStart(RedeliveryErrorHandler.java:852)
>
> at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
> at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
> at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:60)
> at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:74)
> at
> org.apache.camel.processor.DefaultChannel.doStart(DefaultChannel.java:146)
> at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
> at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
> at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:60)
> at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:86)
> at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:64)
> at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
> at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:60)
> at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:74)
> at
> org.apache.camel.processor.DefaultChannel.doStart(DefaultChannel.java:146)
> at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
> at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
> at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:60)
> at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:86)
> at
> org.apache.camel.processor.MulticastProcessor.doStart(MulticastProcessor.java:893)
>
> at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
> at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
> at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:60)
> at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:74)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:77)
>
> at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
> at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
> at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:60)
> at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:74)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:77)
>
> at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
> at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
> at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:60)
> at
> org.apache.camel.impl.RouteService.startChildService(RouteService.java:250)
> at org.apache.camel.impl.RouteService.warmUp(RouteService.java:146)
> at
> org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:1832)
>
> at
> org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:1758)
>
> at
> org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:1548)
>
> at
> org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1440)
>
> at
> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1336)
>
> at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
> at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
> at
> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1314)
>
> at com.cameltest.CamelTestMain.main(CamelTestMain.java:125)
>
>
>


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang

Connect at CamelOne May 24-26
The Open Source Integration Conference
http://camelone.com

Mime
View raw message