Java code was disappeared and got execution failed : null exception

Five Stars

Java code was disappeared and got execution failed : null exception

Hi All,

 

My Java code of Talend job was disappeared, I cant able to run simple printf statement it through's the error "Execution failed: null" when I check the logs from .metadata/.logs it shows the null pointer exception. my job code was below,

 

String foo = "bar";

System.out.println(foo);

Does anybody have the good suggestion to this without deleting the workspace??

 

java_codes.JPG

 

Sixteen Stars

Re: Java code was disappeared and got execution failed : null exception

This will happen sometimes. It's a pain, but is usually easy to resolve. Try the following....

 

1) Shutdown the Studio and start it again. Often this will sort the issue....but not always

2) Go to the Jobscript tab and see if there is code there. If so, copy it to a notepad file, rename your job, create a new instance of your job (using the old name), go to the Jobscript tab and paste the code you copied into your notepad file. Then switch back to the Designer tab, check the generated job, then check the code tab. That works quite well I find.

3) If that does not work (this is the most frustrating way of fixing this), go through each of your components in your job and disable them one at a time. After disabling a component, try looking at the code tab. Eventually the code should appear. When it does you know that the component you last disabled was corrupted. Remove it and add a new one to replace it.

 

Hopefully one of those things will get your code back. If not, you may need to revert to a previous version in your SVN. Although I have not needed to do that in a while.

Five Stars

Re: Java code was disappeared and got execution failed : null exception

Hi friend,

 

I have tried all the ways that you have mentioned above, in my case, it didn't work. Is there any other ways to make appear the java code and I have a null pointer exception in my talend .metadata/.logs.  But my code doesn't have any option to create null pointer exception. 

 

that simple code was:-

 

System.out.println("foo");

 

But the error was (.metadata/.logs):-

!ENTRY org.eclipse.ui 4 0 2018-06-20 11:37:45.396
!MESSAGE Unhandled event loop exception
!STACK 0
org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException)
at org.eclipse.swt.SWT.error(SWT.java:4083)
at org.eclipse.swt.SWT.error(SWT.java:3998)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:137)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4041)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.talend.rcp.intro.Application.start(Application.java:141)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
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:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Caused by: java.lang.NullPointerException
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.emf.codegen.jet.JETEmitter.generate(JETEmitter.java:467)
at org.talend.designer.codegen.config.TalendJetEmitter.generate(TalendJetEmitter.java:529)
at org.eclipse.emf.codegen.jet.JETEmitter.generate(JETEmitter.java:447)
at org.eclipse.emf.codegen.jet.JETEmitter.generate(JETEmitter.java:438)
at org.talend.designer.codegen.proxy.JetProxy.generate(JetProxy.java:54)
at org.talend.designer.codegen.CodeGenerator.instantiateJetProxy(CodeGenerator.java:549)
at org.talend.designer.codegen.CodeGenerator.generateTypedComponentCode(CodeGenerator.java:540)
at org.talend.designer.codegen.CodeGenerator.generateTypedComponentCode(CodeGenerator.java:486)
at org.talend.designer.codegen.CodeGenerator.generateComponentCode(CodeGenerator.java:922)
at org.talend.designer.core.ui.views.CodeView.refresh(CodeView.java:288)
at org.talend.designer.core.ui.views.CodeView.refresh(CodeView.java:232)
at org.talend.designer.core.ui.views.CodeView.access$2(CodeView.java:225)
at org.talend.designer.core.ui.views.CodeView$6.run(CodeView.java:219)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
... 23 more

Five Stars

Re: Java code was disappeared and got execution failed : null exception

As you can suggest me if I look at any other logs to find a real-time issue
Sixteen Stars

Re: Java code was disappeared and got execution failed : null exception

This looks like your Studio may have become corrupted. When did you get this error message? Have you seen it before or was it after trying what I suggested? I *believe* the only time I have seen something like this is when my Studio had become corrupted (Eclipse, which is what the Studio is built on, can sometimes break and all you can do is install a new version). I suspect that your project will be fine. Take a backup of your working folder and install a new studio. Then open up your project through that. I suspect this will fix it. It's a pain, but this is not uncommon in Eclipse environments.

Five Stars

Re: Java code was disappeared and got execution failed : null exception

Hi,

 

This issue seems like that eclipse may be corrupted. but why I got the null exception in the error logs?? can you suggest me what are the logs remaining I should check from talend ??

Sixteen Stars

Re: Java code was disappeared and got execution failed : null exception

The issue is with the this class....

org.talend.designer.codegen.CodeGenerator

 

 

This is nothing to do with your jobs it is part of the Talend Studio. You will find extra Studio logs in your Configuration folder. But I think you should probably reinstall. You can leave your existing Studio where it is for the moment if you don't want to remove it. Just install a new Studio in a different location. 

 

The nullpointerexception will be caused by whatever is corrupted. You could dig around to try to identify this, but I don't think it is worth it. You can reinstall the Studio and be up and running in 30 minutes.

Five Stars

Re: Java code was disappeared and got execution failed : null exception

Hi friend,

 

Here my challenge was I shouldn't delete workspace or uninstall/reinstall the talend. FYI

 

Thanks,

Mani krish 

Sixteen Stars

Re: Java code was disappeared and got execution failed : null exception

Well you don't have to delete the workspace or uninstall Talend Studio, just install a new version in a different location. Is there a problem with taking this approach?