One Star

[resolved] failed to generate

Hi,
I'm getting a error when generating with TOS 3.0.0 in a JAVA project The message is
Execution failed : Failed to generate code.
.
How to I fix/debug this?
Thanks in advanced,
Doug

20 REPLIES
One Star

Re: [resolved] failed to generate

Hi,
I've the same problem.
I made a working job few days ago, and today it doesn't work without changing anything.
I don't know why...
When I display the Code tab, file is blank. No Java source code is generated.
If I click on Run, I've the following error message:
Execution failed : Failed to generate code.

Does anyone know how to repare this error ?
Thx in advance.
FYI:
TOS 3.0.1.r19980
Java project
One Star

Re: [resolved] failed to generate

Ok, I found how to solve my problem.
I you've got the same problem, try this method:
Just after having the error:
- Open the log file ....//workspace/.metadata/.log in notepad.
- Go to the end of the file.
- You will have a stack trace like that:
!STACK 0
org.eclipse.emf.codegen.jet.JETException: InvocationTargetException
at org.eclipse.emf.codegen.jet.JETEmitter.generate(JETEmitter.java:475)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)

at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at org.eclipse.emf.codegen.jet.JETEmitter.generate(JETEmitter.java:467)
... 53 more
Caused by: java.lang.NullPointerException
at org.talend.designer.codegen.translators.processing.TFilterRowMainJava.generate(TFilterRowMainJava.java:134)
... 58 more
- Get the last error in stack trace and find the component raising the error. In my case, the component is TFilterRowMainJava.
- Deactivate all components of the family which raises the error. tFilterRow_1 in my case.
- When I click on "Code" tab, Java source code is displayed.
- Correct errors if exists.
- If you click on run, the job is running...
I hope this help you.
:-)
One Star

Re: [resolved] failed to generate

Hi,
I had the same problem and this topic helped me a lot.
Thanks a lot
RJ
Seventeen Stars

Re: [resolved] failed to generate

hi,
good tips Milou, it could help me
++
One Star

Re: [resolved] failed to generate

Hi
I get the same problem, but when I try to desactivate my "tFilterRow"s, I get SWTEvent error in the ".log" file and the Design View does not refresh content any more.
Any way to recover the job ?
-- Talend 3.1.2 r25815 --
Community Manager

Re: [resolved] failed to generate

Hello
the Design View does not refresh content any more.

After you desactive the error component, like tFilterRow, you should press ctrl+s to save the job, then open the code tab to see if it generate the Java code again.
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] failed to generate

shong,
I cannot desactivate the component, because selecting the option in the context menu generates SWTEvent error.
However I finally managed to recover the job, but I'm not sure what triggered it.
I think opening the component props, modifying some, and save the job may have done the trick.
Anyway job's code gets generated again.
HTH
One Star

Re: [resolved] failed to generate

i am getting the same error...in my case its due to tfiledelimited....i deactivated the component and saw the code...but hw am i supposed to know hw to resolve the errors...pls help m new to talend...
Community Manager

Re: [resolved] failed to generate

Hello
i am getting the same error...in my case its due to tfiledelimited....i deactivated the component and saw the code...

You are doing some wrong settings on tfiledelimited, need to check and correct it. If you can't find the errors, please upload some screenshots of your job.
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] failed to generate

thnx 4 the help as well as the contents of the forum...i repeated the job once again and this time there was no error...
One Star

Re: [resolved] failed to generate

I've seen quite a few people repeat this same error and usually it's to do with the tFilterRow. What I've found is that they have changed the output schema to be different from the input schema for this component. Changing the output back to what the input usually will resolve the error.
One Star

Re: [resolved] failed to generate

This thread just helped me a lot !
The issue was in fact the change of output schema of a tFilterRow, but it has been done quite silently. I think this IDE needs more warning but I understand it's not easy to predict all situations Smiley Wink Anyway, good to know where to look for when you front this very confusing error !!
One Star

Re: [resolved] failed to generate

Hi,
Thanks a lot for this topic.
It help me to resolve my problem !
One Star

Re: [resolved] failed to generate

Hello,
i had the same experience. Is that a bug? The given solution does look like a rather weak workaround, does it not?
One Star

Re: [resolved] failed to generate

Thanks a lot! My problem is solved!
One Star

Re: [resolved] failed to generate

Hi Guys,
I had the same problem. With no 'red box' indicators, it can be hard to find. I solved it by deactivating all nodes and then 'synchronising columns' on all nodes such as 'Filter', 'Sort' and 'Unique'. Once I reactivated the nodes, I press 'play' and it worked.
regards,
Lee
One Star

Re: [resolved] failed to generate

Almost 7 years later, this still worked for me. I had a tfilter where I accidentally removed the filtered column from the input, and f6 started throwing this error. I had just added a complicated tjava to the context setup and thought it must be that, but nope, it was a tfilter having a cow 8 miles down the page. The .log file pointed me toward the tfilter.
One Star

Re: [resolved] failed to generate

Thanks this was very helpful Smiley Happy
One Star

Re: [resolved] failed to generate

Thanks for the post, the issue for me was also in the tFilterRow component.
One Star

Re: [resolved] failed to generate

hi...
i facing this problem plz help
Execution failed : Failed to generate code.