Execution failed : Failed to generate code.

One Star

Execution failed : Failed to generate code.

When attempting to run a job the following error occurs:
Execution failed : Failed to generate code.

Log file indicates an issue with the tMap_1 component.
Log file ..\.metadata\.log shows the following:

!ENTRY org.talend.platform.logging 4 0 2016-05-26 02:47:32.037
!MESSAGE 2016-05-26 02:47:32,036 ERROR org.talend.designer.codegen.CodeGenerator  - InvocationTargetException
!STACK 0
org.eclipse.emf.codegen.jet.JETException: InvocationTargetException
at org.eclipse.emf.codegen.jet.JETEmitter.generate(JETEmitter.java:469)
at org.talend.designer.codegen.config.TalendJetEmitter.generate(TalendJetEmitter.java:684)
at org.eclipse.emf.codegen.jet.JETEmitter.generate(JETEmitter.java:441)
at org.eclipse.emf.codegen.jet.JETEmitter.generate(JETEmitter.java:432)
at org.talend.designer.codegen.proxy.JetProxy.generate(JetProxy.java:54)
at org.talend.designer.codegen.CodeGenerator.generateComponentCode(CodeGenerator.java:766)
at org.talend.designer.codegen.CodeGenerator.generateComponentsCode(CodeGenerator.java:556)
at org.talend.designer.codegen.CodeGenerator.generatesTreeCode(CodeGenerator.java:691)
at org.talend.designer.codegen.CodeGenerator.generateComponentsCode(CodeGenerator.java:557)
at org.talend.designer.codegen.CodeGenerator.generateComponentsCode(CodeGenerator.java:502)
at org.talend.designer.codegen.CodeGenerator.generateProcessCode(CodeGenerator.java:225)
at org.talend.designer.runprocess.java.JavaProcessor.generateCode(JavaProcessor.java:573)
at org.talend.designer.runprocess.maven.MavenJavaProcessor.generateCode(MavenJavaProcessor.java:68)
at org.talend.designer.runprocess.ProcessorUtilities.generateContextInfo(ProcessorUtilities.java:643)
at org.talend.designer.runprocess.ProcessorUtilities.generateCode(ProcessorUtilities.java:482)
at org.talend.designer.runprocess.ProcessorUtilities.generateCode(ProcessorUtilities.java:1298)
at org.talend.designer.runprocess.RunProcessContext$1.run(RunProcessContext.java:561)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:466)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:374)
at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:527)
at org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.run(ProgressMonitorJobsDialog.java:284)
at org.eclipse.ui.internal.progress.ProgressManager.run(ProgressManager.java:1190)
at org.talend.designer.runprocess.RunProcessContext.exec(RunProcessContext.java:524)
at org.talend.designer.runprocess.ui.ProcessComposite.exec(ProcessComposite.java:1450)
at org.talend.designer.runprocess.ui.views.ProcessView$RunAction.run(ProcessView.java:691)
at org.talend.designer.runprocess.ui.actions.RunProcessAction.run(RunProcessAction.java:58)
at org.talend.designer.core.debug.JobLaunchConfigurationDelegate$1.run(JobLaunchConfigurationDelegate.java:84)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.talend.rcp.intro.Application.start(Application.java:197)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor72.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.emf.codegen.jet.JETEmitter.generate(JETEmitter.java:461)
... 51 more
Caused by: java.lang.NullPointerException
at org.talend.designer.codegen.translators.processing.TMapMainJava.generate(TMapMainJava.java:1239)
... 55 more
!ENTRY org.talend.platform.logging 4 0 2016-05-26 02:47:32.038
!MESSAGE 2016-05-26 02:47:32,037 ERROR org.talend.commons.exception.CommonExceptionHandler  - Failed to generate code.
!STACK 0
org.talend.designer.runprocess.ProcessorException: Failed to generate code.
at org.talend.designer.runprocess.java.JavaProcessor.generateCode(JavaProcessor.java:576)
at org.talend.designer.runprocess.maven.MavenJavaProcessor.generateCode(MavenJavaProcessor.java:68)
at org.talend.designer.runprocess.ProcessorUtilities.generateContextInfo(ProcessorUtilities.java:643)
at org.talend.designer.runprocess.ProcessorUtilities.generateCode(ProcessorUtilities.java:482)
at org.talend.designer.runprocess.ProcessorUtilities.generateCode(ProcessorUtilities.java:1298)
at org.talend.designer.runprocess.RunProcessContext$1.run(RunProcessContext.java:561)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:466)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:374)
at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:527)
at org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.run(ProgressMonitorJobsDialog.java:284)
at org.eclipse.ui.internal.progress.ProgressManager.run(ProgressManager.java:1190)
at org.talend.designer.runprocess.RunProcessContext.exec(RunProcessContext.java:524)
at org.talend.designer.runprocess.ui.ProcessComposite.exec(ProcessComposite.java:1450)
at org.talend.designer.runprocess.ui.views.ProcessView$RunAction.run(ProcessView.java:691)
at org.talend.designer.runprocess.ui.actions.RunProcessAction.run(RunProcessAction.java:58)
at org.talend.designer.core.debug.JobLaunchConfigurationDelegate$1.run(JobLaunchConfigurationDelegate.java:84)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.talend.rcp.intro.Application.start(Application.java:197)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
Caused by: org.talend.designer.codegen.exception.CodeGeneratorException: org.eclipse.emf.codegen.jet.JETException: InvocationTargetException in ebs_Product_Update_BRM_SFDC job
at org.talend.designer.codegen.CodeGenerator.generateComponentCode(CodeGenerator.java:776)
at org.talend.designer.codegen.CodeGenerator.generateComponentsCode(CodeGenerator.java:556)
at org.talend.designer.codegen.CodeGenerator.generatesTreeCode(CodeGenerator.java:691)
at org.talend.designer.codegen.CodeGenerator.generateComponentsCode(CodeGenerator.java:557)
at org.talend.designer.codegen.CodeGenerator.generateComponentsCode(CodeGenerator.java:502)
at org.talend.designer.codegen.CodeGenerator.generateProcessCode(CodeGenerator.java:225)
at org.talend.designer.runprocess.java.JavaProcessor.generateCode(JavaProcessor.java:573)
... 40 more
Caused by: org.eclipse.emf.codegen.jet.JETException: InvocationTargetException
at org.eclipse.emf.codegen.jet.JETEmitter.generate(JETEmitter.java:469)
at org.talend.designer.codegen.config.TalendJetEmitter.generate(TalendJetEmitter.java:684)
at org.eclipse.emf.codegen.jet.JETEmitter.generate(JETEmitter.java:441)
at org.eclipse.emf.codegen.jet.JETEmitter.generate(JETEmitter.java:432)
at org.talend.designer.codegen.proxy.JetProxy.generate(JetProxy.java:54)
at org.talend.designer.codegen.CodeGenerator.generateComponentCode(CodeGenerator.java:766)
... 46 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor72.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.emf.codegen.jet.JETEmitter.generate(JETEmitter.java:461)
... 51 more
Caused by: java.lang.NullPointerException
at org.talend.designer.codegen.translators.processing.TMapMainJava.generate(TMapMainJava.java:1239)
... 55 more
tMap_1 component is shown here:

Job is shown below.

Any ideas what I'm missing here?
Regards
Alex Bramford
Moderator

Re: Execution failed : Failed to generate code.

Hi Alex Bramford,
Does this issue repro on all your jobs or a specific job? What's your OS and JDK version? Could you please indicate the build version you are using?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Execution failed : Failed to generate code.

This issue happens when I try to edit & run a job that I had copied from another job.
I was attempting to reuse the logic of another job I'd written
Talend 6.2
JDK 1.8
Windows 7
Moderator

Re: Execution failed : Failed to generate code.

Hi,
This issue happens when I try to edit & run a job that I had copied from another job.

Have you ever successfully executed a job on Talend 6.2?
Do you try to re-create a new job (the same logic of another job you'd written) to see if it works?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Execution failed : Failed to generate code.

Yes, I have successfully executed jobs in Talend 6.2.
If I manually reconstruct the same job it seems to work.
Problem seems to happen if I copy then edit a job.
Regards
Alex Bramford
One Star

Re: Execution failed : Failed to generate code.

Hi All,
I have the same issue and was able to pinpoint it to the "tSalesforceInput" component when linked to a "tMap" as a lookup.
To reproduce:
Create a new job like the picture 1

Execute / Save
Close the job
When you reopen the job you get the message in picture 2

the look up tSalesforceInput as a triange as in picture 3

When you try to run the job you get picture 4

My Setup:
TOS-DI 6.2
Java 1.8
Windows 7
Attached is also my .log
talend.log.log
Thank you for the help.
Best Regards,
Victor 
One Star

Re: Execution failed : Failed to generate code.

Issue occurs for tSalesforceInput" component linked to a "tMap" as a lookup.
Symptoms: 
1) Upon opening the job, a yellow triangle appears on the tSalesforceInput component with the message:
- 'This component has to much "Row" type outputs.'
2) Whilst a connector is already present (tSalesforceInput --> row6 --> tMap) right clicking on the tSalesforceInput component offers Main and Iterate rows. This appears incorrect: I understand there can be only one Main row connected to tSalesforceInput.
3) The issue reappears each time Talend  is restarted. In particular it reappears on a job that I verified as working at close of play.
Restarting and reloading the job yielded:
     a)The yellow triangle
     b) Execution failed : Failed to generate code.

Attached log file contains entries from start to reload to execution of job.
Execution_failed.log.log
Moderator

Re: Execution failed : Failed to generate code.

Hi,
Would you mind making a testing on Talend 6.1.1 to see if this issue repro? Have you tried to re-install your studio 6.2 to see if it works?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Execution failed : Failed to generate code.

Hi Sabrina,
I reinstalled 6.2 and the issue still happens.
I have tried it in 6.1.1 and the issue does not occur.
Where you able to reproduce it on your side?
Best regards,
Victor
Moderator

Re: Execution failed : Failed to generate code.

Hi,
We will make a testing  for your issue on V 6.2 to see if this issue repro then come back to you as soon as we can.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Execution failed : Failed to generate code.

Hi Sabrina,
Further to your posting that your team will make a test, I've updated my post with artefacts as follows that you may wish to use in testing.
To recap: Issue occurs for tSalesforceInput" component linked to a "tMap" as a lookup.
Symptom: a job that was working before restarting Talend, fails when Talend is restarted.
Reproduced the issue  in 6.1 and 6.2.
I've attached failure jobs and success jobs that you can compare or import to reproduce the failure in Talend 6.1 and 6.2.
Kind Regards
Alex Bramford
Product_Update_XLS_SFDC_6_1_Working_Before_Restart.zip.zipProduct_Update_XLS_SFDC_6_1_Broken_After_Restart.zip.zipProduct_Update_XLS_SFDC_6_2_Working_Before_Restart.zip.zipProduct_Update_XLS_SFDC_6_2_Broken_After_Restart.zip.zip
Product_Update_XLS_SFDC_6_1_Broken_After_Restart.zip_20160530-1215.zipProduct_Update_XLS_SFDC_6_1_Working_Before_Restart.zip_20160530-1215.zipProduct_Update_XLS_SFDC_6_2_Broken_After_Restart.zip_20160530-1215.zipProduct_Update_XLS_SFDC_6_2_Working_Before_Restart.zip_20160530-1215.zip
Moderator

Re: Execution failed : Failed to generate code.

Hi,
Here is a jira issue:https://jira.talendforge.org/browse/TDI-36372
Could you please take a look at it?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Execution failed : Failed to generate code.

Morning Sabrina,
The Jira issue looks correct. I'm watching the issue and and will update it if relevant.
Thanks for the help.
Best Regards,
Victor
One Star

Re: Execution failed : Failed to generate code.

Thanks for raising the Jira ticket, Sabrina.
I'm watching the ticket and I look forward to further updates.
Alex
Moderator

Re: Execution failed : Failed to generate code.

Hi,
Feel free to let us know if there is any further help we can give.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Execution failed : Failed to generate code.

G'Day Sabrina,
I see from the JIRA ticket 
https://jira.talendforge.org/browse/TDI-36372
that this has been fixed and is ready for QA.
Has there been further progress, and will there be a release containing the fix any time soon?
Regards
Alex Bramford
Moderator

Re: Execution failed : Failed to generate code.

Hi alexbramford,
We will track this jira issue and keep you posted.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Four Stars

Re: Execution failed : Failed to generate code.

Any updates on when this will be released as a fix? 
I am now trying to downgrade but cannot import my existing project into an older version of talend. Is there a 6.2.1 beta available?
Moderator

Re: Execution failed : Failed to generate code.

Hi,
This issue has been fixed on version 6.2.1
The release of version 6.2.1 will be available in the end of July. We will keep you posted on it.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Execution failed : Failed to generate code.

Can you confirm that this bug was actually fixed in 6.2.1? I just upgraded to 6.2.1 from 6.1.0 and I am getting a very similar error when I try to open any job containing a tSalesforceOutput. Jobs without these components open fine. 
One Star

Re: Execution failed : Failed to generate code.

I have made a design flow. But When I save and run the job, I am getting below error.
Execution failed : Failed to generate code.

Job SCD ended at 01:38 23/09/2016. ......
When I checked the log file, I am getting below component issue, as per above discussion.(TMysqlSCD)
at org.talend.designer.codegen.translators.databases.mysql.TMysqlSCDBeginJava.genDimensionAttributeClass(TMysqlSCDBeginJava.java:984)

at org.talend.designer.codegen.translators.databases.mysql.TMysqlSCDBeginJava.generate(TMysqlSCDBeginJava.java:2997)
Temporary Solution: When I deactivate this component(TMysqlSCD), code generates in code tab.
But if I use this component, again getting same issue.

But need permanent solution to fix this bug...Any help please...Smiley Happy
Moderator

Re: Execution failed : Failed to generate code.

Hi Abhirup,
Could you please indicate on which build version you got this issue?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Execution failed : Failed to generate code.

Hi Abhirup,
Could you please indicate on which build version you got this issue?
Best regards
Sabrina

Hi xdshi,
I have installed Talend 6.2.1.
Your help is needed.. Thank You! Smiley Happy
Four Stars

Re: Execution failed : Failed to generate code.

Even I am facing similar issue and my Talend version is 6.1.1 

Is this just a talend known issue or can we some how fix it. Please suggest.


@xdshi wrote:
Hi,
Would you mind making a testing on Talend 6.1.1 to see if this issue repro? Have you tried to re-install your studio 6.2 to see if it works?
Best regards
Sabrina

Thanks in advance !

 

 

Moderator

Re: Execution failed : Failed to generate code.

Hello,

According to this jira issue:https://jira.talendforge.org/browse/TUP-5465, it has been fixed on v 6.2.1.

Best regards

Sabrina

 

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.