From Thursday, July, 9, 3:00 PM Pacific,
our Community site will be in
read-only mode
through Sunday, July 12th.
Thank you for your patience.

"Could not find or load main class" error when deploying a Web Service or Route onto Runtime


The option "Use an independent process to run subjob" on tRunJob causes a "Could not find or load main class" error when deploying a Web Service or a Route onto the Runtime, but the same Web Service or Route runs fine in Talend Studio. This article explains the issue and offers a solution.



This issue can occur in all versions of the Talend ESB product.



Below is a sample of a Web Service provider Job containing a tRunJob component that calls a child Job and for which the ''Use an independent process to run subjob'' option is enabled.




If the Web Service provider Job is executed in Talend Studio, you can successfully call the Web Service. But if the Web Service is deployed onto the Runtime, you will get the following error when calling the Web Service:

org.apache.cxf.binding.soap.SoapFault: Child job returns 1. It doesn't terminate normally.
Error: Could not find or load main class esb_demo.childjob_0_1.childJob
	at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(

This problem also exists in a Route if it has a cTalendJob component that calls a data integration Job, and the data integration Job contains a tRunJob with the "Use an independent process to run subjob" option selected.



The "Use an independent process to run subjob" option on tRunJob is not compatible with the Runtime. When this option is selected, the child Job will be executed as a separate application. It is a bundle installed on the Runtime after the Web Service or Route is deployed onto the Runtime, therefore it cannot find the executable class file for the child Job. To resolve this issue, disable the "Use an independent process to run subjob" option on the tRunJob component and re-deploy the Web Service or Route onto Runtime.

Related Jira Issues

TESB-10858 NoClassDefFound, ClassNotFoundException Error during deploying my WS into runtime_ESBSE, it call another job (helper) by tRunJob - Closed

Version history
Revision #:
9 of 9
Last update:
‎07-05-2019 04:23 AM
Updated by:
Five Stars

This was my exact issue. Wish I'd found this article sooner. 


Are there plans to resolve this in the future or is it a Karaf limitation? 




Even so tRunJob works in quite some cases within ESB Data Services there are some hard problems which can occur which are related to the different 'life cycle' the job runs through in the Data Services (Web Service) use case. By this, since 6.3.1 we have only a limited support for tRunJob within the ESB use cases and recommend to use Joblets in case something needs to be shared between a Service and a DI Job or between different Data Services.
Given this, the answer is pretty much:  No, we do not plan to change something in the handling with tRunJobs and ESB Data Services any time soon.
(Please see also: - tRunJob is supported with limitations for more details what limited support means here)

There might be something in between Joblets and tRunJob what we need in future!? But for now the above represents the status on your question.



Four Stars

This case isn't checked and i have same error.WS_test.png


Five Stars
Hey there, With Talend 7.x, it seems there's also a problem with the build process when building osgi container, at least on my workstation. Here a temporary solution : Sincerely,