Bug 212744 - Can't import plug-ins (NPE) when Java app is running
Summary: Can't import plug-ins (NPE) when Java app is running
Status: VERIFIED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.4 M4   Edit
Assignee: bartosz michalik CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-12-12 09:09 EST by Dani Megert CLA
Modified: 2007-12-13 03:47 EST (History)
3 users (show)

See Also:


Attachments
possible fix (916 bytes, patch)
2007-12-12 11:55 EST, bartosz michalik CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2007-12-12 09:09:09 EST
I20071212-0010.

Caused by bug 185502.

1. start a simple Java app (no plug-ins)
2. try to import binary projects

==>

!ENTRY org.eclipse.ui 4 0 2007-12-12 15:03:27.639
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NullPointerException
	at org.eclipse.pde.internal.ui.launcher.BundleLauncherHelper.getWorkspaceBundleMap(BundleLauncherHelper.java:33)
	at org.eclipse.pde.internal.ui.wizards.imports.PluginImportWizard.areConflictingConfigurations(PluginImportWizard.java:125)
	at org.eclipse.pde.internal.ui.wizards.imports.PluginImportWizard.performFinish(PluginImportWizard.java:92)
	at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:742)
	at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:373)
	at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:623)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:227)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:952)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3750)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3361)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
	at org.eclipse.jface.window.Window.open(Window.java:801)
	at org.eclipse.ui.internal.handlers.WizardHandler$Import.executeHandler(WizardHandler.java:159)
	at org.eclipse.ui.internal.handlers.WizardHandler.execute(WizardHandler.java:280)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:240)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:475)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:470)
	at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:165)
	at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:247)
	at org.eclipse.ui.internal.actions.CommandAction.runWithEvent(CommandAction.java:157)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:582)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:499)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:410)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:952)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3750)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3361)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2381)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2345)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2211)
	at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:473)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:468)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:362)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:175)
	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:561)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:501)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1239)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1215)
	at org.eclipse.core.launcher.Main.main(Main.java:30)
Comment 1 bartosz michalik CLA 2007-12-12 11:55:04 EST
Created attachment 85087 [details]
possible fix

As I couldn't reproduce that I can only assume that this is a good patch. NPE can happen in this method only when ILaunchConfiguration passed as parameter to org.eclipse.pde.internal.ui.launcher.BundleLauncherHelper.getWorkspaceBundleMap(BundleLauncherHelper.java:33)
is null.
Comment 2 Brian Bauman CLA 2007-12-12 12:30:57 EST
Bartosz, thanks for creating a fix so quickly.  Since it was milestone week and this is a major sev. bug, I was also working on the bug.

I figured we would take it one step further by checking to see if the running ILaunchConfiguration was actually a PDE configuration.  If it is not, then  we can ignore it and move on.  It seemed a little funny to get a warning about a possible conflict when the only thing running was a java application :)
Comment 3 Dani Megert CLA 2007-12-12 12:34:49 EST
>I figured we would take it one step further by checking to see if the running
>ILaunchConfiguration was actually a PDE configuration.  If it is not, then  we
>can ignore it and move on. 
What about a simple Java launch config that runs an SWT snippet which is in a Java project that has the imported SWT project on its dependency list?

>As I couldn't reproduce that ...
I can now also not reproduce with the simple steps from comment 0. I made
several tests and launch configs, so maybe it was caused by another config and
not the simply one I was running.
Comment 4 Brian Bauman CLA 2007-12-12 15:53:57 EST
> What about a simple Java launch config that runs an SWT snippet which is in a
> Java project that has the imported SWT project on its dependency list?

I was trying to fix bug 212763 without knowing you opened it.  I will remove the fix I placed in there to look for PDE launch configs and we can fix it in that bug.
Comment 5 Brian Bauman CLA 2007-12-12 15:55:20 EST
Reassigned bug to Bartosz since we used his patch to fix the bug.  Will be in I20071212-1800. 
Comment 6 Dani Megert CLA 2007-12-13 03:47:49 EST
Tried various scenarios using I20071212-1800 and could not trigger the NPE anymore.