Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Basit
Contributor III
Contributor III

NoClassDefFoundError when starting job in Karaf

Hi there,

 

i am experiencing some issues when i want to call a job from Karaf. When I run it in Talen Open Studio it works fine. 

I have one parent job which handles a POST request and then starts a child job which executes a POST with a tRESTClient component.

The parent job looks as follows:

0683p000009M24N.jpg

0683p000009M24S.jpg

 

And this is the design of the child job:

0683p000009M24X.jpg

 

 

 

I used a simple API for testing the tRestClient:

0683p000009M21k.jpg

As I already mentioned running this job in Open Studio works fine. The problem occurs when I deploy it in Karaf. I get this exception:

Exception in component tRunJob_1 (RestRequestParent)
java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean
        at local_project.restrequestparent_0_1.RestRequestParent.tRESTRequest_1_LoopProcess(RestRequestParent.java:2145)
        at local_project.restrequestparent_0_1.RestRequestParent$RestServiceProviderImpl4TalendJob.processRequest(RestRequestParent.java:391)
        at local_project.restrequestparent_0_1.RestRequestParent$RestServiceProviderImpl4TalendJob.path1(RestRequestParent.java:479)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:179)
        at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
        at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:192)
        at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:103)
        at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
        at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96)
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
        at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
        at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:267)
        at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:247)
        at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:79)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1182)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1116)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
        at org.eclipse.jetty.server.Server.handle(Server.java:534)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:333)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108)
        at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean
        at local_project.restrequestparent_0_1.RestRequestParent.tRESTRequest_1_LoopProcess(RestRequestParent.java:1638)
        ... 34 more
Caused by: java.lang.ClassNotFoundException: org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean cannot be found by local_project.RestRequestParent_0.1.0
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:484)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387)
        at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 35 more

Any idea how this can be solved? I am using version 7.0.1 and Java 1.8 by the way.

 

Best regards

Basit

Labels (2)
16 Replies
Anonymous
Not applicable

Spent 2 weeks to refactor a job with subjobs so that it is easier to read / modify / change and added new features etc. Now I am running into this very same issue. Please let me know if you were able to find a solution for it. Deselecting "Use an independent process to run subjob" didn't work. Neither deploying the subjobs separately.

navds
Creator II
Creator II

If it's up to me, I would recommend against Talend ESB for production. So many issues and instability without talking about lack of documentation and support

 https://help.talend.com/reader/5rUSEFXF6OUSM_fjCYR~kA/14V1zILctluBKoF~eqNJgQ

Anonymous
Not applicable

Same problem here,

we refactored some jobs with subjobs as they were starting to get very hard to read ... and run into the very same problems

Did you find any solution? seesing the post date i don't think so, but who knows? 0683p000009MACn.png

 

Sincerely,

Nrd

 

(ps : sorry posted another thread before finding this one)

Anonymous
Not applicable

Hey there,

 

Problem seems to be with the build process when building osgi container, but i found a temporary solution : https://community.talend.com/t5/Design-and-Development/Job-with-Subjobs-error-when-deployed-as-OSGI-...

Sicnerely,

Basit
Contributor III
Contributor III
Author

I think I could finally solve this issue. After quite some time we had another case where we ran into the same exception.

For this new job the following workaround helped:

  • first, deploy all child jobs in Karaf
  • in my case i stopped them afterwards in Karaf because they don't need to run on their own Command: stop {id} The state of the job should be then shown as "resolved" (check with "list" in Karaf)
  • then deploy the parent job in Karaf as usual

If I now send a REST request to the parent job there are no more exceptions ( kind of embarassing that I didn't think of this earlier 😅 )

Basit
Contributor III
Contributor III
Author

Hi @Navalona Ramanantoanina​ 

 

 

I was finally able to solve this issue for us. Look at my latest reply maybe it can help you.

 

Regards,

Basit

Basit
Contributor III
Contributor III
Author

Hi @Gilles LEO​ 

 

I was finally able to solve this issue for us. Look at my latest reply maybe it can help you.

 

Regards,

Basit