Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 316978

Summary: NPE attempting to export an RPM on a non-RPM project
Product: [Tools] Linux Tools Reporter: Andrew Overholt <overholt>
Component: RPMAssignee: Alexander Kurtakov <akurtakov>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: linux.rpm-inbox, sgehwolf
Version: unspecified   
Target Milestone: 0.9.0   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Attempt 1 none

Description Andrew Overholt CLA 2010-06-15 17:02:25 EDT
If I pick Export -> RPM on a non-RPM project (this is a CVS project), I get the following in the workspace log (.metadata/.log) and the Next button in the wizard doesn't do anything when pressed.

!ENTRY org.eclipse.ui 4 0 2010-06-15 16:58:26.370
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NullPointerException
        at org.eclipse.linuxtools.rpm.core.RPMConfiguration.initialize(RPMConfiguration.java:48)
        at org.eclipse.linuxtools.rpm.core.RPMConfiguration.<init>(RPMConfiguration.java:30)
        at org.eclipse.linuxtools.rpm.core.RPMProject.<init>(RPMProject.java:37)
        at org.eclipse.linuxtools.rpm.ui.RPMExportPage.<init>(RPMExportPage.java:52)
        at org.eclipse.linuxtools.rpm.ui.RPMExportWizard.addPages(RPMExportWizard.java:108)
        at org.eclipse.jface.wizard.WizardSelectionPage.getNextPage(WizardSelectionPage.java:113)
        at org.eclipse.ui.internal.dialogs.WorkbenchWizardSelectionPage.getNextPage(WorkbenchWizardSelectionPage.java:100)
        at org.eclipse.ui.internal.dialogs.ImportExportPage.getNextPage(ImportExportPage.java:431)
        at org.eclipse.jface.wizard.WizardDialog.nextPressed(WizardDialog.java:887)
        at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:426)
        at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
        at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
        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.Display.runDeferredEvents(Display.java:3552)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3171)
        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$Export.executeHandler(WizardHandler.java:98)
        at org.eclipse.ui.internal.handlers.WizardHandler.execute(WizardHandler.java:274)
        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.executeCommand(HandlerService.java:169)
        at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
        at org.eclipse.ui.internal.actions.CommandAction.runWithEvent(CommandAction.java:157)
        at org.eclipse.ui.internal.actions.CommandAction.run(CommandAction.java:171)
        at org.eclipse.ui.actions.ExportResourcesAction.run(ExportResourcesAction.java:116)
        at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:168)
        at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
        at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
        at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
        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.Display.runDeferredEvents(Display.java:3552)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3171)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
        at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
        at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
        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:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
        at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Comment 1 Severin Gehwolf CLA 2010-06-18 13:41:39 EDT
I seem to get NPEs in all cases (even if it's a RPM project), except when the spec file is currently selected.
Comment 2 Charley Wang CLA 2010-06-18 15:40:48 EDT
Created attachment 172249 [details]
Attempt 1

This attempt just does a quick null check and presents the RPMExportPage error controls if the project is not valid.
Comment 3 Charley Wang CLA 2010-06-18 15:47:13 EDT
Maybe it would be better to let the user choose to create an RPM Nature for his/her project right in the wizard?
Comment 4 Alexander Kurtakov CLA 2011-08-23 16:20:09 EDT
Fixed in master.
917f3ca..e586237