Community
Participate
Working Groups
What steps will reproduce the problem? 1. using eclipse 4.7.0 on macosx 2. i used cmd-3 to select the import existing projects entry 3. NPE -- Error Details -- Date: Fri Sep 01 11:43:49 EDT 2017 Message: java.lang.NullPointerException Severity: Error Product: Eclipse 4.7.0.20170620-1800 (org.eclipse.epp.package.rcp.product) Plugin: org.eclipse.ui Session Data: eclipse.buildId=4.7.0.I20170612-0950 java.version=1.8.0_131 java.vendor=Oracle Corporation BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US Framework arguments: -product org.eclipse.epp.package.rcp.product -keyring /Users/eddie/.eclipse_keyring Command-line arguments: -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.rcp.product -keyring /Users/eddie/.eclipse_keyring Exception Stack Trace: java.lang.NullPointerException at org.eclipse.ui.internal.wizards.datatransfer.WizardProjectsImportPage.<init>(WizardProjectsImportPage.java:416) at org.eclipse.ui.wizards.datatransfer.ExternalProjectImportWizard.addPages(ExternalProjectImportWizard.java:85) at org.eclipse.jface.wizard.WizardDialog.createContents(WizardDialog.java:577) at org.eclipse.jface.window.Window.create(Window.java:426) at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1096) at org.eclipse.ui.internal.handlers.WizardHandler.execute(WizardHandler.java:311) at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:291) at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:92) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55) at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:305) at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:239) 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:494) at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:487) at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210) at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommand(LegacyHandlerService.java:390) at org.eclipse.ui.internal.quickaccess.CommandElement.execute(CommandElement.java:74) at org.eclipse.ui.internal.quickaccess.SearchField$2.handleElementSelected(SearchField.java:198) at org.eclipse.ui.internal.quickaccess.QuickAccessContents.handleSelection(QuickAccessContents.java:597) at org.eclipse.ui.internal.quickaccess.QuickAccessContents.access$0(QuickAccessContents.java:587) at org.eclipse.ui.internal.quickaccess.QuickAccessContents$4.mouseUp(QuickAccessContents.java:786) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:221) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4257) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1502) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1525) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1510) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1314) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4081) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3698) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1155) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1044) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153) at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151) 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:388) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590) at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
(In reply to Eddie Galvez from comment #0) > What steps will reproduce the problem? > 1. using eclipse 4.7.0 on macosx > 2. i used cmd-3 to select the import existing projects entry > 3. NPE > I tried following your steps, but I wasn't able to reproduce. The offending code seems to be the second line in the code below, where we get location > file > absolute path. if (firstElement instanceof IResource) { this.initialPath = ((IResource) firstElement).getLocation().toFile().getAbsolutePath(); } My theory is that IResource#getLocation() is null because the resource is not stored in the local filesystem. Could you please tell me whether the project is located on your local filesystem or not?
The code should be NPE resilient... and I was importing an outside set of files into the workspace, so I'm not certain why it's consider any IResource. I don't have it handy here to reproduce, but I think I'd be okay with the issue closing by guarding that NPE appropriately.
were you importing files from a network location?
no, it was local
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.