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

Bug 269519

Summary: [regression] p2 director fails with an NPE trying to install CDT into the target Eclipse SDK
Product: [Eclipse Project] Equinox Reporter: Martin Oberhuber <mober.at+eclipse>
Component: p2Assignee: P2 Inbox <equinox.p2-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: major    
Priority: P3 CC: pascal
Version: 3.5   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Shellscript for installing CDT into Eclipse SDK
none
Batchfile for installing with p2 director none

Description Martin Oberhuber CLA 2009-03-20 10:23:04 EDT
Created attachment 129456 [details]
Shellscript for installing CDT into Eclipse SDK

Eclipse SDK BuildID: I20090313-0100 (3.5m6)
CDT BuildID: 6.0.0M6-200903161435
Host OS: Tested on linux-gtk and windows XP

I'm running a little shellscript to call p2 director in order to install CDT (from its zipped Repository) into the Eclipse SDK.

My p2 commands is basically the same as referenced in the Docs:
   http://127.0.0.1:16775/help/topic/org.eclipse.platform.doc.isv/guide/p2_director.html

with the one exception that I do not pass in a -version argument. This was not necessary in previous builds -- the script ran successfully with m4 and m5; and, I do not know where to obtain a proper version. Thus I'm assuming that the -version argument is optional, and/or documentation is missing for the p2 director -version argument. My command is (full shellscript attached):

./eclipse/eclipse -nosplash \
  -data install-ws -consolelog -clean \
  -application org.eclipse.equinox.p2.director.app.application \
  -metadataRepository file:${curdir}/install-source/ \
  -artifactRepository file:${curdir}/install-source/ \
  -installIU org.eclipse.cdt.feature.group \
  -vmargs \
    -Xms128M -Xmx256M -XX:PermSize=128M -XX:MaxPermSize=256M 

and the failure generated by p2 director is:

!ENTRY org.eclipse.osgi 4 0 2009-03-20 14:38:51.933
!MESSAGE Application error
!STACK 1
java.lang.NullPointerException
	at org.eclipse.equinox.internal.p2.director.app.Application.updateRoamingProperties(Application.java:534)
	at org.eclipse.equinox.internal.p2.director.app.Application.run(Application.java:403)
	at org.eclipse.equinox.internal.p2.director.app.Application.start(Application.java:509)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
	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:368)
	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:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:556)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:511)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1284)
Comment 1 Martin Oberhuber CLA 2009-03-20 10:25:29 EDT
Created attachment 129459 [details]
Batchfile for installing with p2 director
Comment 2 Pascal Rapicault CLA 2009-03-20 10:33:28 EDT

*** This bug has been marked as a duplicate of bug 268185 ***
Comment 3 Martin Oberhuber CLA 2009-03-20 13:01:50 EDT
I can confirm that the workaround of adding

  -destination (absolutePath)/eclipse

works. I did not manage to install into a separate extension location that way, which would be link via a *.link file from dropins/ -- but I might not have tried hard enough.

The -version argument turned out not to be necessary. I suggest marking it as optional in the docs. Do you need a separate bug for this?

http://help.eclipse.org/stable/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/p2_director.html
Comment 4 Pascal Rapicault CLA 2009-03-20 21:09:55 EDT
- p2 does not deal with extension location as target of an installation. This is the famous extension location discussion. I think you are cc'ed on it.

- please open a bug for the doc.  thx