Community
Participate
Working Groups
Build Identifier: N20100512-2000 When trying to install a bundle via prov command (ProvCommandProvider), NullPointerException is produced. The reason is lack of registered profiles but the command expects at least 1 profile. When there's no profile, command returns null for IStatus. This seems unexpected by ProvCommandProvider - it shows to the end user the exception instead of some meaningful message what went wrong. Here is the code that causes the exception: ... IStatus s = ProvisioningHelper.install(agent, iu, version, ProvisioningHelper.getProfile(agent, profileId), new NullProgressMonitor()); ... if (s.isOK()) ... Reproducible: Always Steps to Reproduce: 1.Download and unzip Equinox (http://download.eclipse.org/equinox/drops/N20100512-2000/index.php) 2.Start it in root folder (equinox) using java -jar plugins/org.eclipse.osgi_3.6.0.N20100512-2000.jar -configuration configuration –console 3.Setup dropins folder in config.ini: org.eclipse.equinox.p2.reconciler.dropins.directory=dropins 4.Describe all plugins (and start them) in Equinox/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info 5.Execute the command provinstall abc 123 6. Observe the exception: osgi> provinstall com.ibm.icu.source_4.0.1.v20090822 4.0.1 java.lang.NullPointerException at org.eclipse.equinox.internal.p2.console.ProvCommandProvider._provinstall(ProvCommandProvider.java:136) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:155) at org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:303) at org.eclipse.osgi.framework.internal.core.FrameworkConsole.console(FrameworkConsole.java:288) at org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:224) at java.lang.Thread.run(Unknown Source)
Created attachment 169069 [details] ProvCommandProvider adapted to show meaningful message when profile is missing instead of throwing NPE
Patch released in HEAD for build toward 3.7 M4