amharrison / jactr-eclipse

jACT-R Eclipse Integration
GNU General Public License v3.0
3 stars 3 forks source link

NPE: Export Executable Model #13

Open monochromata opened 9 years ago

monochromata commented 9 years ago

After selecting jACT-R > Executable Model and clicking Next in the Eclipse(Mars) Export dialog, a NullPointerException is thrown:

eclipse.buildId=4.5.0.I20150603-2000 java.version=1.8.0_31 java.vendor=Oracle Corporation BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de_DE Framework arguments: -product org.eclipse.epp.package.committers.product Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.committers.product

org.eclipse.ui Error Wed Aug 12 20:58:33 CEST 2015 Unhandled event loop exception

java.lang.NullPointerException at org.jactr.eclipse.demo.export.RunConfigurationWizardPage.checkProject(RunConfigurationWizardPage.java:75) at org.jactr.eclipse.demo.export.RunConfigurationWizardPage.(RunConfigurationWizardPage.java:67) at org.jactr.eclipse.demo.export.ExportDeployableWizard.addPages(ExportDeployableWizard.java:51) at org.eclipse.jface.wizard.WizardSelectionPage.getNextPage(WizardSelectionPage.java:116) at org.eclipse.ui.internal.dialogs.WorkbenchWizardSelectionPage.getNextPage(WorkbenchWizardSelectionPage.java:98) at org.eclipse.ui.internal.dialogs.ImportExportPage.getNextPage(ImportExportPage.java:427) at org.eclipse.jface.wizard.WizardDialog.nextPressed(WizardDialog.java:878) at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:425) at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:619) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4362) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1113) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4180) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3769) at org.eclipse.jface.window.Window.runEventLoop(Window.java:827) at org.eclipse.jface.window.Window.open(Window.java:803) at org.eclipse.ui.internal.handlers.WizardHandler$Export.executeHandler(WizardHandler.java:106) at org.eclipse.ui.internal.handlers.WizardHandler.execute(WizardHandler.java:290) at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:295) at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90) 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.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56) at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:252) at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:234) at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132) at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152) at org.eclipse.core.commands.Command.executeWithChecks(Command.java:493) at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:486) at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210) at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommand(LegacyHandlerService.java:343) at org.eclipse.ui.internal.actions.CommandAction.runWithEvent(CommandAction.java:160) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:420) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4362) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1113) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4180) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3769) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:654) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139) 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:669) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608) at org.eclipse.equinox.launcher.Main.run(Main.java:1515) at org.eclipse.equinox.launcher.Main.main(Main.java:1488)

amharrison commented 9 years ago

This is actually a fairly easy fix. As you need to have the to-be-exported run configuration selected, which should yield the project. However, it brings up a more important question as to the relevance of this feature. It was largely intended as a mechanism to fully export all dependencies of a running model as an executable, but this isn't a normal usage pattern, as it doesn't support any IDE profiling, debugging, or tracing.

If a model developer is at the level of experience where this is actually useful, they'll generally be competent enough to do it themselves (as this functionality is just a wrapper for Eclipse's product export).

I'm inclined to fix the bug, but remove this bundle from the default installation altogether.

monochromata commented 9 years ago

Maybe instead of exporting the model, developers might want to embed it in a third-party application. In that case they might better use a build process e.g. using Maven instead of manual exports. I'm fine if you remove the feature.