One Star

Java error when building job & extracting zip file

Hi, when I build two of my three jobs I get this error, but only when I select the "Extract the zip file" check box:
java.lang.NullPointerException
at org.talend.repository.ui.wizards.exportjob.JobScriptsExportWizardPage.finish(JobScriptsExportWizardPage.java:1362)
at org.talend.repository.ui.wizards.exportjob.JavaJobScriptsExportWSWizardPage.finish(JavaJobScriptsExportWSWizardPage.java:1613)
at org.talend.repository.ui.wizards.exportjob.JobScriptsExportWizard.performFinish(JobScriptsExportWizard.java:124)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:811)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:430)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3776)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1367)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1390)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1375)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1187)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3622)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3277)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.talend.repository.ui.actions.ExportJobScriptAction.doRun(ExportJobScriptAction.java:117)
at org.talend.repository.ui.actions.AContextualAction$2.run(AContextualAction.java:607)
at org.talend.repository.RepositoryWorkUnit.executeRun(RepositoryWorkUnit.java:93)
at org.talend.core.repository.model.AbstractRepositoryFactory.executeRepositoryWorkUnit(AbstractRepositoryFactory.java:237)
at org.talend.repository.localprovider.model.LocalRepositoryFactory.executeRepositoryWorkUnit(LocalRepositoryFactory.java:3199)
at org.talend.core.repository.model.ProxyRepositoryFactory.executeRepositoryWorkUnit(ProxyRepositoryFactory.java:1975)
at org.talend.repository.ui.actions.AContextualAction.run(AContextualAction.java:616)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3776)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1367)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1390)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1375)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1187)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3622)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3277)
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(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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)
Seems that maybe there's something different about 2 of my jobs?
The exported jobs seem to work fine for me, but they fail to export if the Extract file box is checked, so I need to export the zip, extract it, and then run it
Thank you, any advice would be much appreciated ? especially if someone has run into this before Smiley Happy
6 REPLIES

Re: Java error when building job & extracting zip file

check your project description under file->properties. If it is blank, add something to it there.
Not sure if this will fix it for you, but its worth a try Smiley Wink
One Star

Re: Java error when building job & extracting zip file

Hi, it was empty, I put something in there, but as mentioned one of the jobs was previously working (now is not though)
I'm not sure if it's related but the job builder also seems to think that once I've save a job once to a folder that the "Target file already exists.", even once I have moved or deleted the original file
One Star

Re: Java error when building job & extracting zip file

Edit: It looks like there is no path by default (or an unknown default path) in the "To archive file:" field, so perhaps it is trying to save the Job in some default location that I'm not aware of until I change the path.
When I click Browse it remembers my last path and I can click Save which then populates the path in the "To archive file:" field.
And thus, I am now able to export an extracted zip file, with no Java error
However, I can't actually run the resulting sh file, I type this into terminal:
/Users/me/Talend/Jobs/JobName/JobName_run.sh
I get:
-bash: /Pat/To/Jobs/JobName/JobName_run.sh: Permission denied
I can run the Job successfully only if I build the file as a zip, extract it manually and then run the file like this:
/Users/me/Talend/Jobs/JobName_1.0/JobName/JobName_run.sh
What do I need to do to be able to run the automatically unzipped Job? Thanks Smiley Happy
One Star

Re: Java error when building job & extracting zip file

Finally,
I notice that a jobInfo.properties file, as well as a lib folder gets created and placed at the same folder level as the exported Job folder itself; the file (unsure about the folder, but I assume so) gets overwritten with only the most recent Job information if there is more than one Job folder in the same folder
I don't think this is the cause for the permission denied error, because I get it for both Jobs

Re: Java error when building job & extracting zip file

you may need to mark the .sh script as executable (chmod +x run_jobname.sh) before you can run it directly like you have above. If you dont want to take this additional step after exporting the job, invoke bash and then pass the script as an argument:

bash /path/to/job/run_jobname.sh
One Star

Re: Java error when building job & extracting zip file

Thanks that did it Smiley Happy