Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 328394 - [example] NullPointerException when running prestartupdatable example
Summary: [example] NullPointerException when running prestartupdatable example
Status: CLOSED WORKSFORME
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.6.1   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: Juno   Edit
Assignee: P2 Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted, usability
Depends on:
Blocks:
 
Reported: 2010-10-21 14:53 EDT by Mario Van Steenberghe CLA
Modified: 2012-06-29 12:18 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mario Van Steenberghe CLA 2010-10-21 14:53:05 EDT
Build Identifier: 20100917-0705

When I try to run the prestartupdatable example on eclipse 3.6.1, I always get the following NullPointerException :

java.lang.reflect.InvocationTargetException
	at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:477)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
	at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507)
	at org.eclipse.equinox.p2.examples.rcp.prestartupdate.ApplicationWorkbenchWindowAdvisor.postWindowOpen(ApplicationWorkbenchWindowAdvisor.java:94)
	at org.eclipse.ui.internal.WorkbenchWindow.fireWindowOpened(WorkbenchWindow.java:1332)
	at org.eclipse.ui.internal.WorkbenchWindow.open(WorkbenchWindow.java:798)
	at org.eclipse.ui.internal.Workbench$24.runWithException(Workbench.java:1235)
	at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4041)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
	at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:803)
	at org.eclipse.ui.internal.Workbench$31.runWithException(Workbench.java:1567)
	at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4041)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2548)
	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.equinox.p2.examples.rcp.prestartupdate.Application.start(Application.java:20)
	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:79)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:618)
	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)
Caused by: java.lang.NullPointerException
	at org.eclipse.equinox.p2.examples.rcp.prestartupdate.P2Util.checkForUpdates(P2Util.java:61)
	at org.eclipse.equinox.p2.examples.rcp.prestartupdate.ApplicationWorkbenchWindowAdvisor$1.run(ApplicationWorkbenchWindowAdvisor.java:76)
	at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
	... 38 more

I'm new to P2, so I don't understand the internals. Though I have been doing some digging inside the source code I think the following is a little strange :

SearchForUpdatesResolutionJob --> computeProfileChangeRequest --> session.getProfileRegistry().getProfile(profileId); --> returns null !!! 

So there is no profile ? Do I need to define a profile ?

Reproducible: Always

Steps to Reproduce:
1. Check-out "org.eclipse.equinox.p2.examples.rcp.prestartupdate" from CVS
2. Run product
Comment 1 Ian Bull CLA 2010-11-09 19:23:03 EST
While I don't know for sure, it could be a configuration / setup problem. Do you have a eclipse.p2.data.area set?  Also, are you starting the declarative services bundle?  These are two common problems that could lead to no profile.
Comment 2 Ian Bull CLA 2012-06-29 12:18:34 EDT
Closing as works for me. We can't do much without more context.