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

Overview

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.

 

Environment

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

 

Symptoms/Description

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.

 

untitled.png

 

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(Soap11FaultInInterceptor.java:84)

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.

 

Resolution

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 #:
6 of 6
Last update:
‎05-04-2017 03:01 PM
Updated by:
 
Labels (2)
Comments
brianjmcguirk

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? 

dlenzen

Hi,

 

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: https://help.talend.com/reader/T~QD4QE2MB1IXzrWUOhT5Q/9up4OprRnHMKjDi0WoPoyw - 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.

 

Thanks,
Dietmar