Community
Participate
Working Groups
I'm not sure how to reproduce the issue, but I got a report of a user receiving a NullPointerException when running the p2 directory application: !SESSION 2012-08-11 01:15:24.047 ----------------------------------------------- eclipse.buildId=I20120608-1400 java.version=1.6.0_32 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US Framework arguments: -application org.eclipse.equinox.p2.director -repository file:///tmp/formic_1775706431/update -uninstallIU org.eclim.installer.feature.group Command-line arguments: -clean -application org.eclipse.equinox.p2.director -repository file:///tmp/formic_1775706431/update -uninstallIU org.eclim.installer.feature.group !ENTRY org.eclipse.equinox.p2.core 4 0 2012-08-11 01:15:53.443 !MESSAGE Exception during event notification !STACK 0 java.lang.NullPointerException at org.eclipse.equinox.internal.p2.director.app.DirectorApplication.notify(DirectorApplication.java:653) at org.eclipse.equinox.internal.p2.core.ProvisioningEventBus.dispatchEvent(ProvisioningEventBus.java:108) at org.eclipse.equinox.internal.p2.core.ProvisioningEventBus.dispatchEvent(ProvisioningEventBus.java:1) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) Looking at the code it appears that the director's notify method is invoked prior to the initialization of the artifactReposForRemoval variable. The notify method was added to resolve https://bugs.eclipse.org/bugs/show_bug.cgi?id=340971 Another reference to the same NPE was found on the debian mailing list: http://lists.debian.org/debian-java/2012/05/msg00129.html
CQ:WIND00-WB4-2402 We also see this backtrace sometimes, typically on command-line when uninstalling a feature with the p2 director.
Created attachment 249305 [details] added null check in the notify method A null check is missing in the notify method- this same check is there in other places where artifactReposForRemoval is used.
thanks fix pushed to master.
Thanks for the Fix ! Could we get this backported to Luna SR2 ? - Since the message is really confusing for some of our command-line install scenarios.
I believe that the fix is inclomplete. To really fix the NPE, also the "metadataReposForRemoval" needs to be checked as well. Both variables are null, without checking "metadataReposForRemoval" also, the NPE will still occur, just at a different line.
*** Bug 380244 has been marked as a duplicate of this bug. ***
Please provide a complete gerrit patch for Luna and for any previous version and I will release.
(In reply to Pascal Rapicault from comment #7) > Please provide a complete gerrit patch for Luna and for any previous version > and I will release. Prepared 2 changes on gerrit, - one for master (Mars): https://git.eclipse.org/r/40194 - one for R4_4_maintenance (Luna): https://git.eclipse.org/r/40197
Thanks for the patches. They have been committed to the appropriate branches.