One Star

Job run from camel route

Dear sirs,
this topic is related to
http://www.talendforge.org/forum/viewtopic.php?id=19534
where I cannot expose jobs as services (I don't know what to do with the .KAR file, seems it won't deploy and nobody has answered yet)
So I decided to expose a camel endpoint and call a job from the endpoint (well - still I have no idea how to pass data, but first things first). So I created a simple route. (TOS 5.0)
When the route is started from TOS, it seems running, returns a correct and nice WSDL, published endpoint. but invoking the WS I got response
      <soap:Fault>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>java.lang.Error: java.lang.Error: java.lang.NoClassDefFoundError: org/talend/webservice/helper/conf/ServiceHelperConfiguration</faultstring>
</soap:Fault>

I found the class in talend-ws,,,jar in TOS, but not in runtime - so seem it is not a way.
of cause I've added camel-tis to dependencies
deploying the route into a runtime I got anyway a not very nice exception
karaf@trun> Failed to create route cCXF_1 at: >>> To <<< in route: Route <<< in route: Route[[Fro
m[cxf://http://localhost:9040/esb/Test1?dataFormat... because of Failed to resol
ve endpoint: talend://demo1.child4_0_1.Child4?context=Default due to: No compone
nt found with scheme: talend
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java
:820)
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java
:165)
at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelCont
ext.java:697)
at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(Defau
ltCamelContext.java:1654)
at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelCo
ntext.java:1441)
at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext
.java:1338)
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.j
ava:1316)
at demo1.route1_0_1.route1$1CamelImpl.doStart(route1.java:201)
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.MainSupport.run(MainSupport.java:136)
at demo1.route1_0_1.route1.Route(route1.java:295)
at demo1.route1_0_1.route1.runJobInTOS(route1.java:403)
at org.talend.esb.job.controller.internal.RouteAdapter.run(RouteAdapter.
java:86)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve en
dpoint: talend://demo1.child4_0_1.Child4?context=Default due to: No component fo
und with scheme: talend
at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelCon
text.java:449)
at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelCo
ntextHelper.java:48)
at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinitio
n.java:180)
at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRout
eContext.java:110)
at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRout
eContext.java:116)
at org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.
java:61)
at org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.
java:55)
at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDef
inition.java:437)
at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinit
ion.java:183)
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java
:817)
... 18 more

my biggest problem is the mentioned thread - I need to expose a job as web service. In TOS 4.2.1 it worked (though I had to stanrd them manually ), but at least it was more intuitive.
Maybe I've just got stucked in past procedures, missed something, but any guidance is welcome Smiley Happy
Kind regards
Gabriel
2 REPLIES
One Star

Re: Job run from camel route

Hello,
I think a route is not the solution for your problem.
To create a webservice In TOS for ESB 5.0 you must follow these steps:
- create or import a wsdl in services
- associate a new or existing job to operation defined in your wsdl (this job should contain a tesbresquest and tesbresponse)
- right click on your wsdl under services and export your service to a .kar package
- put your kar file in the deploy folder of your karaf container
- test your service with a client like soap ui, create a project and add wsdl (http://<your endpoint>?wsdl)
from my own experience I put 8040 as port for my service otherwise my service wasn't accessible from other locations
8040 is the default port for osgi http service in TESB 5.0, you can define in the pax web config file of the container
you can follow screencasts from R.Zubairov here http://www.screenr.com/user/zubairov
it might help
One Star

Re: Job run from camel route

Hi Ytuzet,
thank you very much, you've helped me a lot Smiley Happy seems I missed the deploy folder.
I still got some errors, but seems the webinars will help me go on.
indeed the route was a desperate try Smiley Tongue
Have a nice weekend
Carpe diem
Gabriel