4
votes

I unable to delete the project from the workspace. Eclipse throws NPE and I have NFI how to resolve this issue.

java.lang.NullPointerException
    at org.eclipse.ltk.ui.refactoring.resource.DeleteResourcesWizard$DeleteResourcesRefactoringConfigurationPage.createControl(DeleteResourcesWizard.java:89)
    at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.createContents(RefactoringWizardDialog2.java:631)
    at org.eclipse.jface.window.Window.create(Window.java:431)
    at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089)
    at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation$1.run(RefactoringWizardOpenOperation.java:171)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:192)
    at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:115)
    at org.eclipse.ltk.internal.ui.refactoring.actions.DeleteResourcesHandler.execute(DeleteResourcesHandler.java:40)
    at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
    at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
    at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
    at org.eclipse.ui.internal.handlers.HandlerService.executeCommandInContext(HandlerService.java:270)
    at org.eclipse.ui.internal.ide.actions.LTKLauncher.runCommand(LTKLauncher.java:95)
    at org.eclipse.ui.internal.ide.actions.LTKLauncher.openDeleteWizard(LTKLauncher.java:47)
    at org.eclipse.ui.actions.DeleteResourceAction.run(DeleteResourceAction.java:481)
    at org.eclipse.jdt.internal.ui.refactoring.reorg.DeleteAction.run(DeleteAction.java:162)
    at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:274)
    at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:250)
    at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
    at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:119)
    at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
    at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
    at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
    at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468)
    at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:786)
    at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:885)
    at org.eclipse.ui.internal.keys.OutOfOrderListener.handleEvent(OutOfOrderListener.java:76)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1282)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1267)
    at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1294)
    at org.eclipse.swt.widgets.Widget.gtk_key_press_event(Widget.java:730)
    at org.eclipse.swt.widgets.Control.gtk_key_press_event(Control.java:2841)
    at org.eclipse.swt.widgets.Composite.gtk_key_press_event(Composite.java:734)
    at org.eclipse.swt.widgets.Tree.gtk_key_press_event(Tree.java:1977)
    at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1743)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4796)
    at org.eclipse.swt.widgets.Tree.windowProc(Tree.java:3485)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:4360)
    at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method)
    at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:8189)
    at org.eclipse.swt.widgets.Display.eventProc(Display.java:1238)
    at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
    at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:2237)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3159)
    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.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
    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:620)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1384)

and this is my environment :-

eclipse.buildId=M20110210-1200
java.version=1.6.0_21
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_AU
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os linux -ws gtk -arch x86 -product 
org.eclipse.epp.package.jee.product
4
Does it works if you just retry it? If not, does it work if you close all editors?Kai

4 Answers

4
votes

The related Eclipse bug is 345477. In that post, some ia32-libs bugs are referenced. The suggested workaround in that bug is executing the following before executing Eclipse:

export GDK_PIXBUF_MODULE_FILE=/usr/lib32/gdk-pixbuf-2.0/2.10.0/loaders.cache

I can confirm that this works, even with the Ubuntu-Mono-Light icon set. I use Eclipse 32 bit on Java 32 bit on Ubuntu 11.04 64 bit.

1
votes

I've noticed this same problem using Eclipse 3.6 SR2 on Ubuntu 11.04. It works fine however on Ubuntu 10.04 and Windows 7 using the same version of Eclipse. The NullPointerException is coming from line 89 of DeleteResourcesWizard because image is null:

87    Image image= parent.getDisplay().getSystemImage(SWT.ICON_QUESTION);
88    Label imageLabel = new Label(composite, SWT.NULL);
89    imageLabel.setBackground(image.getBackground());

The quick fix I've found for Ubuntu 11.04 is to use a different theme (like Clearlooks) or icon set (like GNOME). The default theme that doesn't work for me is Ambiance, which defaults to the Ubuntu-Mono-Dark icon set. I guess it must be missing the icon (or it was renamed) needed by SWT.ICON_QUESTION and Eclipse doesn't gracefully deal with not finding it.

0
votes

The closest bug (issue 302791) was fixed in 3.6 (which I suspect you have, with a build Id M20110210-1200)

Your error seems to take place at the very beginning of the process, since it isn't able to create the `DeleteResourcesWizard.
It could be because of:

  • some strange selection (did you try selecting the project in the Package Explorer? in the Resource Explorer?)
  • some deleted resources still referenced by the project.

If you can reproduce the problem every time, this can be worth a new Eclipse bug report.

0
votes

Thanks, I've changed my icon set to GNOME and it worked! Ubuntu 11.04 the worst Ubuntu ever! It seems like Ubuntu is aiming to be like Windows ME and Vista...