Expert Consultancy from Yellow Pelican

Uncompilable Code

A site about Talend

Troubleshooting Uncompilable Code

We've looked a troubleshooting JetException errors, where Talend simply gives up on generating code. Often, Talend will generate your Java code; but there is an error. This article explains some of the common causes and an approach to resolving the issues.

Example

Here is an example of a recent issue that I have experienced.

I had a trivial Job that performed as expected. I wanted to run two child Jobs in Parallel, so I set Multi thread execution to true (Job->Extra settings).

I then ran the Job and received the following error.

No exception of type Error can be thrown; an exception type must be a subclass of Throwable
The method printStackTrace() is undefined for the type Error

Investigation

The first place to start an investigation in to this type of error (uncompilable code), is to select the code tab, to see the line(s) of Java code that is giving the error. Remember, Talend is a code-generator and the code is re-generated each time you run your Job, or select the code tab.

For this error, the offending code-section is displayed below.

	...
	} catch (Error e_tRunJob_1) {

		e_tRunJob_1.printStackTrace();
		globalMap.put("tRunJob_1_SUBPROCESS_STATE", -1);

	} finally {
	...

Usually, you will see an error in your own code. Some bad Java code in a tJava component, a poorly completed dialog box or any number of opportunities to enter bad Java code.

Id the cause is not obvious, or it appears not to be an issue with user-entered code, I usually start to disable components, disabling the most recently added first. Hopefully, this takes you to the most recently working version of the Job, allowing you to narrow down where the issue lies.

In the case of the example being described here, it was clear that the setting of Multi threa execution was the cause of the problem.

Further Examination of the Code Tab

The dirst error message is complaining that Error is not a subclass of Throwable No exception of type Error can be thrown; an exception type must be a subclass of Throwable.

My selecting Error in the code window, you can press F3 or right-click, to Open Definition.

From doing this, it was clear that this was not the intended definition. This definition was for a Routine that had recently been created when I imported a WSDL. Clearly, there was a naming conflict.

A point to note on Routines

When you create a new Job, all Routine




Expert Consultancy from Yellow Pelican
comments powered by Disqus

© www.TalendByExample.com