Community
Participate
Working Groups
Build 20020529 I'm running a workspace that was created on WinXP on Linux. The workspace contains a runtime workbench launch configuration. When I try to bring up the launch configuration dialog, the following NPE occurs: !MESSAGE java.lang.NullPointerException !STACK 0 java.lang.NullPointerException at org.eclipse.pde.internal.ui.launcher.BasicLauncherTab.performApply(BasicLauncherTab.java:281) at org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup.performApply(AbstractLaunchConfigurationTabGroup.java:90) at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationDialog.updateWorkingCopyFromPages(LaunchConfigurationDialog.java:2110) at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationDialog.isWorkingCopyDirty(LaunchConfigurationDialog.java:1545) at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationDialog.updateButtons(LaunchConfigurationDialog.java:2556) at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationDialog.refreshStatus(LaunchConfigurationDialog.java:778) at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationDialog.setLaunchConfiguration(LaunchConfigurationDialog.java:1398) at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationDialog.selectionChanged(LaunchConfigurationDialog.java:1319) at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:147) at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:1153) at org.eclipse.jface.viewers.StructuredViewer.setSelection(StructuredViewer.java:903) at org.eclipse.jface.viewers.Viewer.setSelection(Viewer.java:342) at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationDialog.doInitialTreeSelection(LaunchConfigurationDialog.java:478) at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationDialog.createContents(LaunchConfigurationDialog.java:428) at org.eclipse.jface.window.Window.create(Window.java:278) at org.eclipse.jface.window.Window.open(Window.java:527) at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationDialog.doLastLaunchedConfig(LaunchConfigurationDialog.java:558) at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationDialog.open(LaunchConfigurationDialog.java:519) at org.eclipse.debug.internal.ui.actions.OpenLaunchConfigurationsAction.run(OpenLaunchConfigurationsAction.java:133) at org.eclipse.jface.action.Action.runWithEvent(Action.java:749) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent(ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0(ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent(ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:75) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:804) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1380) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1224) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1095) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1078) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:739) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:462) 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:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:200) at org.eclipse.core.launcher.Main.run(Main.java:643) at org.eclipse.core.launcher.Main.main(Main.java:476)
Launch configurations are not portable and cannot be reused between operating systems. There are several attributes that just cannot be portable. For example, the JVM to use to run only applies to the machine on which it was detected. Workspace is also machine-specific. It is possible to do something about it, but we will have to do it on a post- 2.0 time frame.
Have you added a fix for the NPE? You can't make Eclipse workspaces non-portable.
Please see above comment. Also, note that this is not purely a cross-platform issue. This bug also prevents sharing of workspaces across different machines on the same platform. This is a major problem which can impede Eclipse development.
The statement is not true. You can still share your workspace. What you need to do is not share the launch configuration i.e. go to the common tab and mark it as local (not shared). Workspace data (plug-ins, fragments) have nothing to do with workspace metadata (in this case, stored launch configuration). I don't see how sharing launch configuration (which has a fairly reasonable default values and does not have many controls anyway) is a critical issue. Just create a new (local) configuration - it will pick up the correct platform-specific data. I reaffirm the original decision not to fix this in 2.0. You can take it up to eclipse.org for voting if you want.
The issue is with LOCAL launch configurations, not shared configs.
Steps: Machine 1 Host - C:\Eclipse20020602 Data - C:\Eclipse VM - C:\Java\jdk1.4.1_b11\bin\java.exe Machine 2 Host - C:\Eclipse20020602\eclipse Data - C:\workspaces\eclipse VM - C:\jdk1.3.1\bin\java.exe 1. Launch Eclipse on Machine 1 as specified (new workspace). 2. Import org.eclipse.ui and all required plugins as binary. 3. Open the Java perspective. 4. Pull down the chevron on the debug button, choose "Debug As...->Runtime workbench" 5. When the target Eclipse finishes loading, close it. Also close the host. 6. Set up Machine 2 as indicated, using the workspace from Machine 1. 7. Launch Eclipse on Machine 2 as specified (with workspace from M1). 8. Open the Java perspective. 9. Pull down the chevrom on the debug button, choose "Debug..." The dialog fails to realize. A NullPointerException is written to the log. On the current code base (20020602), the NPE now occurs here:org.eclipse.pde.internal.ui.launcher.BasicLauncherTab.performApply (BasicLauncherTab.java:296)
This NPE is worth fixing. The Launch Configuration Dialog will never come up if this isn't fixed. This weeks an innocent workspace (no shared launch configurations) from being able to run or debug any further programs. All pde needs to do is protect against a missing VMInstall -this looks like a very modest edit - 1-2 lines. As additional protection, the launch configuration support should consider wrapping this failure case with an exception handler as well - to catch the problem creating this and reporting the error. I will open a new defect report for this.
Agreed that the particular NPE should be fixed. My point was that PDE should not try to be super helpful by trying to reconcile configurations that clearly contain data that cannot be moved between machines (e.g. location of the workspace, the particular JVM to use etc.).
I actually opened a bug report for that right after I opened this one: Bug 18306 - Launch configuration dialog is vulnerable to all delegates
F3 candidate.
Fixed the NPE.