One Star

Invoking WS from TESB - SpringBusFactory

Dear sirs,
we have a simple job to to call a Web Service, from the Talend Studio 4.2 it works nicelly.
When published to the TESB 4.2 and starting the job, we receive a following exception. I've found a link discussing possible problem, but no resolution so far.
http://stackoverflow.com/questions/7274510/error-java-lang-classcastexception-class-org-apache-cxf-b...
Can anybody help me with it please? We've event reinstalled the t-esb and started cleanm the only features enabled out of default is the camel-jetty for a camel route (bridgging endpoints).
The same behaviour is when running on the t-esb-5m
Kind regards
Gabriel
karaf@tesb> Exception in component tWebService_1
java.lang.RuntimeException: java.lang.ClassCastException: class org.apache.cxf.bus.spring.SpringBusFactory
at org.apache.cxf.BusFactory.newInstance(BusFactory.java:169)
at org.apache.cxf.BusFactory.newInstance(BusFactory.java:140)
at org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:69)
at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:106)
at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:97)
at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.newInstance(Dyna
micClientFactory.java:132)
at org.talend.webservice.helper.ServiceInvokerHelper.<init>(ServiceInvok
erHelper.java:75)
at org.talend.webservice.helper.ServiceInvokerHelper.<init>(ServiceInvok
erHelper.java:107)
at org.talend.webservice.helper.ServiceInvokerHelper.<init>(ServiceInvok
erHelper.java:102)
at office_pilot.invokevkbo2_0_1.InvokeVKBO2.tFixedFlowInput_1Process(Inv
okeVKBO2.java:1354)
at office_pilot.invokevkbo2_0_1.InvokeVKBO2.runJobInTOS(InvokeVKBO2.java
:2848)
at org.talend.esb.job.controller.internal.TalendJobLauncher$1.run(Talend
JobLauncher.java:116)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassCastException: class org.apache.cxf.bus.spring.SpringB
usFactory
at java.lang.Class.asSubclass(Class.java:3018)
at org.apache.cxf.BusFactory.newInstance(BusFactory.java:164)
... 12 more
2011-10-19 10:23:20|O8Zrpx|O8Zrpx|O8Zrpx|OFFICE_PILOT|InvokeVKBO2|Default|6|Java
Exception|tWebService_1|java.lang.RuntimeException:java.lang.ClassCastException
: class org.apache.cxf.bus.spring.SpringBusFactory|1
7 REPLIES
One Star

Re: Invoking WS from TESB - SpringBusFactory

Just a note - when I look inside the archive, I see cxf-2.2.4.jar bunded along the job, what is different than CXF in tne ESB (2.4.2)m can it cause the problem?
One Star

Re: Invoking WS from TESB - SpringBusFactory

the some more detailed stack trace Smiley Sad I hope it will be only something stupind in configuration
java.lang.ClassCastException: class org.apache.cxf.bus.spring.SpringBusFactory
at java.lang.Class.asSubclass(Class.java:3018)
at org.apache.cxf.BusFactory.getBusFactoryClass(BusFactory.java:303)
at org.apache.cxf.BusFactory.newInstance(BusFactory.java:230)
at org.apache.cxf.BusFactory.newInstance(BusFactory.java:217)
at org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:98)
at org.apache.cxf.BusFactory.createThreadBus(BusFactory.java:164)
at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:154)
at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:139)
at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.newInstance(DynamicClientFactory.java:140)
at org.talend.webservice.helper.ServiceInvokerHelper.<init>(ServiceInvokerHelper.java:75)
at org.talend.webservice.helper.ServiceInvokerHelper.<init>(ServiceInvokerHelper.java:107)
at org.talend.webservice.helper.ServiceInvokerHelper.<init>(ServiceInvokerHelper.java:102)
at org.talend.webservice.helper.ServiceInvokerHelper.<init>(ServiceInvokerHelper.java:98)
at pilot2.getweatherjob_0_1.GetWeatherJob.tFixedFlowInput_1Process(GetWeatherJob.java:665)
at pilot2.getweatherjob_0_1.GetWeatherJob.runJobInTOS(GetWeatherJob.java:1034)
at org.talend.esb.job.controller.internal.TalendJobLauncher$1.run(TalendJobLauncher.java:116)
at java.lang.Thread.run(Thread.java:619)
15:16:32,296 | ERROR | Thread-63 | ache.cxf.common.logging.LogUtils 371 | - - | Failed to instantiate bus factory.
java.lang.ClassCastException: class org.apache.cxf.bus.spring.SpringBusFactory
at java.lang.Class.asSubclass(Class.java:3018)
at org.apache.cxf.BusFactory.newInstance(BusFactory.java:241)
at org.apache.cxf.BusFactory.newInstance(BusFactory.java:217)
at org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:98)
at org.apache.cxf.BusFactory.createThreadBus(BusFactory.java:164)
at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:154)
at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:139)
at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.newInstance(DynamicClientFactory.java:140)
at org.talend.webservice.helper.ServiceInvokerHelper.<init>(ServiceInvokerHelper.java:75)
at org.talend.webservice.helper.ServiceInvokerHelper.<init>(ServiceInvokerHelper.java:107)
at org.talend.webservice.helper.ServiceInvokerHelper.<init>(ServiceInvokerHelper.java:102)
at org.talend.webservice.helper.ServiceInvokerHelper.<init>(ServiceInvokerHelper.java:98)
at pilot2.getweatherjob_0_1.GetWeatherJob.tFixedFlowInput_1Process(GetWeatherJob.java:665)
at pilot2.getweatherjob_0_1.GetWeatherJob.runJobInTOS(GetWeatherJob.java:1034)
at org.talend.esb.job.controller.internal.TalendJobLauncher$1.run(TalendJobLauncher.java:116)
at java.lang.Thread.run(Thread.java:619)
15:16:32,296 | INFO | Thread-63 | ler.internal.TalendJobLauncher$1 117 | - - | Talend Job finished with code 1
Employee

Re: Invoking WS from TESB - SpringBusFactory

Hi,
Sorry I might be missing something, but is there a reason why you are not using tESBConsumer?
Thanks
One Star

Re: Invoking WS from TESB - SpringBusFactory

Hello cdynes,
the called web service is an external service outside ESB. Then as I understood from other forum postsm the tWebService artefact should be more useful. Or am I wrong?
Gabriel
One Star

Re: Invoking WS from TESB - SpringBusFactory

Maybe I should think first and write later - I may still call the WS by tWebServiceInput / Advanced
Then the calling job expose as an ESB web service and all other calls can do it bt the tESBConsumer. Just I wanted to ommit the coding
with tWebServiceInput (I don't know how to return output there). So if the coding can be ommited, it would be perfect.
Carpe diem
Gabriel
Employee

Re: Invoking WS from TESB - SpringBusFactory

Hi
Definitely recommend the new tESBConsumer components and not the tWebService component. The tESB* components are based on CXF and are the recommended approach.

Cheers
One Star

Re: Invoking WS from TESB - SpringBusFactory

Hello,
Just an additional question - so I may configure the web service client inserting a cxf.xml configuration into the exported JAR? Smiley Surprised where to put it in the TOS?
But ok, you've persuaded me, I'll try it out. btw - the external service has a deep and complex message structure, so I need handle data types more with force than care.
Thank's for the tip
Gabriel