Bug 435407 - Export Feature or Build UpdateSite -> NullPointerException
Summary: Export Feature or Build UpdateSite -> NullPointerException
Status: RESOLVED DUPLICATE of bug 438652
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Framework (show other bugs)
Version: 4.0   Edit
Hardware: PC Windows 7
: P2 normal with 3 votes (vote)
Target Milestone: Luna SR1   Edit
Assignee: Vikas Chandra CLA
QA Contact:
URL:
Whiteboard:
Keywords: investigate
: 427523 436540 438493 (view as bug list)
Depends on:
Blocks: 440154
  Show dependency tree
 
Reported: 2014-05-21 10:19 EDT by Jürgen Berger CLA
Modified: 2014-10-01 16:29 EDT (History)
10 users (show)

See Also:


Attachments
System info (595.83 KB, text/plain)
2014-05-21 10:31 EDT, Jürgen Berger CLA
no flags Details
Screenshot (22.35 KB, image/png)
2014-05-22 01:33 EDT, Jürgen Berger CLA
no flags Details
Project to recreate (3.60 KB, application/zip)
2014-08-26 07:22 EDT, Vikas Chandra CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jürgen Berger CLA 2014-05-21 10:19:06 EDT
I try to export a feature.
The error occures if I try build the UpdateSite or export the feature.


!ENTRY org.eclipse.core.jobs 4 2 2014-05-21 16:10:51.455
!MESSAGE An internal error occurred during: "Build Site".
!STACK 0
java.lang.NullPointerException
	at org.eclipse.osgi.internal.resolver.NativeCodeSpecificationImpl.isSatisfiedBy(NativeCodeSpecificationImpl.java:88)
	at org.eclipse.osgi.internal.module.ResolverImpl.isResolvable(ResolverImpl.java:285)
	at org.eclipse.osgi.internal.module.ResolverImpl.resolveBundles(ResolverImpl.java:639)
	at org.eclipse.osgi.internal.module.ResolverImpl.resolve(ResolverImpl.java:477)
	at org.eclipse.osgi.internal.resolver.StateImpl.resolve(StateImpl.java:545)
	at org.eclipse.osgi.internal.resolver.StateImpl.resolve(StateImpl.java:605)
	at org.eclipse.pde.internal.build.site.BuildTimeSite.getRegistry(BuildTimeSite.java:186)
	at org.eclipse.pde.internal.build.BuildScriptGenerator.generateFeatures(BuildScriptGenerator.java:276)
	at org.eclipse.pde.internal.build.BuildScriptGenerator.generate(BuildScriptGenerator.java:127)
	at org.eclipse.pde.internal.core.exports.FeatureExportOperation.doExport(FeatureExportOperation.java:257)
	at org.eclipse.pde.internal.core.exports.FeatureBasedExportOperation.run(FeatureBasedExportOperation.java:50)
	at org.eclipse.pde.internal.core.exports.SiteBuildOperation.run(SiteBuildOperation.java:66)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 1 Jürgen Berger CLA 2014-05-21 10:31:37 EDT
Created attachment 243348 [details]
System info
Comment 2 Jürgen Berger CLA 2014-05-22 01:33:19 EDT
Created attachment 243377 [details]
Screenshot
Comment 3 Curtis Windatt CLA 2014-06-04 09:33:38 EDT
*** Bug 436540 has been marked as a duplicate of this bug. ***
Comment 4 Curtis Windatt CLA 2014-06-04 09:34:27 EDT
*** Bug 427523 has been marked as a duplicate of this bug. ***
Comment 5 Curtis Windatt CLA 2014-06-04 09:36:11 EDT
This will likely be difficult to track down as the problem occurs inside the OSGi State (which is essentially deprecated).
Comment 6 Jan Rosczak CLA 2014-06-05 01:21:49 EDT
If this OSGi State is deprecated, what are we supposed to use to build an update site from within the Eclipse IDE (I am aware of Ant P2 Tasks and Maven Tycho)?
Comment 7 Curtis Windatt CLA 2014-06-05 09:00:12 EDT
(In reply to Jan Rosczak from comment #6)
> If this OSGi State is deprecated, what are we supposed to use to build an
> update site from within the Eclipse IDE (I am aware of Ant P2 Tasks and
> Maven Tycho)?

PDE will continue to use the OSGi State for the forseeable future.  The effort to move to the new OSGi resolver would be substantial and is not planned for any specific release at this time.  The fact that the OSGi State is no longer under development will make investigating and fixing this bug more difficult, but we still want to investigate it.
Comment 8 Jan Rosczak CLA 2014-06-05 09:44:28 EDT
Thanks for taking the time to fix this. Maybe may investigation as described in Bug 436540 could help. It seems that in the code one would only need to be prepared that the variable platformOS can be null and maybe add a "continue" statement to process the next entry in the list as was done in the old code of the 3.8 version.
Comment 9 Curtis Windatt CLA 2014-07-02 10:13:31 EDT
*** Bug 438493 has been marked as a duplicate of this bug. ***
Comment 10 Gary C CLA 2014-07-02 13:52:15 EDT
I am getting the same problem that was reported in 438493.  My log file shows three errors are logged whenever I run the product export wizard.  The first two are identical, and the following:

!ENTRY org.eclipse.pde.build 4 1 2014-07-02 11:16:33.109
!MESSAGE Problems parsing the feature file:C:/Tools/eclipse-luna-4.4/features/org.eclipse.equinox.sdk_3.10.0.v20140606-1602/feature.xml.
!STACK 1
org.eclipse.core.runtime.CoreException: Problems parsing the feature file:C:/Tools/eclipse-luna-4.4/features/org.eclipse.equinox.sdk_3.10.0.v20140606-1602/feature.xml.
	at org.eclipse.pde.internal.build.site.BuildTimeFeatureFactory.parseBuildFeature(BuildTimeFeatureFactory.java:85)
	at org.eclipse.pde.internal.build.site.BuildTimeFeatureFactory.createFeature(BuildTimeFeatureFactory.java:50)
	at org.eclipse.pde.internal.build.site.BuildTimeSite.createFeature(BuildTimeSite.java:472)
	at org.eclipse.pde.internal.build.site.compatibility.FeatureReference.getFeature(FeatureReference.java:39)
	at org.eclipse.pde.internal.build.site.BuildTimeSite.resolveFeatureReferences(BuildTimeSite.java:330)
	at org.eclipse.pde.internal.build.site.BuildTimeSite.findFeature(BuildTimeSite.java:299)
	at org.eclipse.pde.internal.build.site.BuildTimeSite.findFeature(BuildTimeSite.java:291)
	at org.eclipse.pde.internal.build.BuildScriptGenerator.generateFeatures(BuildScriptGenerator.java:252)
	at org.eclipse.pde.internal.build.BuildScriptGenerator.generate(BuildScriptGenerator.java:127)
	at org.eclipse.pde.internal.core.exports.FeatureExportOperation.doExport(FeatureExportOperation.java:257)
	at org.eclipse.pde.internal.core.exports.ProductExportOperation.run(ProductExportOperation.java:106)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Contains: Invalid ID "org.eclipse.equinox.p2.sdk" or version "null" encountered.
Contains: Invalid ID "org.eclipse.equinox.p2.core.feature" or version "null" encountered.
Contains: Invalid ID "org.eclipse.equinox.p2.extras.feature" or version "null" encountered.
Contains: Invalid ID "org.eclipse.equinox.p2.rcp.feature" or version "null" encountered.
Contains: Invalid ID "org.eclipse.core.runtime.feature" or version "null" encountered.
Contains: Error parsing feature: "require" must include at least one "import" element.
!SUBENTRY 1 org.eclipse.equinox.p2.publisher.eclipse 4 17 2014-07-02 11:16:33.109
!MESSAGE Problems parsing the feature file:C:/Tools/eclipse-luna-4.4/features/org.eclipse.equinox.sdk_3.10.0.v20140606-1602/feature.xml.
!SUBENTRY 2 org.eclipse.equinox.p2.publisher.eclipse 4 17 2014-07-02 11:16:33.109
!MESSAGE Invalid ID "org.eclipse.equinox.p2.sdk" or version "null" encountered.
!SUBENTRY 2 org.eclipse.equinox.p2.publisher.eclipse 4 17 2014-07-02 11:16:33.109
!MESSAGE Invalid ID "org.eclipse.equinox.p2.core.feature" or version "null" encountered.
!SUBENTRY 2 org.eclipse.equinox.p2.publisher.eclipse 4 17 2014-07-02 11:16:33.109
!MESSAGE Invalid ID "org.eclipse.equinox.p2.extras.feature" or version "null" encountered.
!SUBENTRY 2 org.eclipse.equinox.p2.publisher.eclipse 4 17 2014-07-02 11:16:33.109
!MESSAGE Invalid ID "org.eclipse.equinox.p2.rcp.feature" or version "null" encountered.
!SUBENTRY 2 org.eclipse.equinox.p2.publisher.eclipse 4 17 2014-07-02 11:16:33.109
!MESSAGE Invalid ID "org.eclipse.core.runtime.feature" or version "null" encountered.
!SUBENTRY 2 org.eclipse.equinox.p2.publisher.eclipse 4 17 2014-07-02 11:16:33.109
!MESSAGE Error parsing feature: "require" must include at least one "import" element.


When I look at the feature.xml file for the org.eclipse.equinox.sdk feature I see the five Invalid IDs above at the bottom where they are listed as required features:

   <requires>
     <feature id="org.eclipse.equinox.p2.sdk"/>
     <feature id="org.eclipse.equinox.p2.core.feature"/>
     <feature id="org.eclipse.equinox.p2.extras.feature"/>
     <feature id="org.eclipse.equinox.p2.rcp.feature"/>
     <feature id="org.eclipse.core.runtime.feature"/>
   </requires>

I don't know if this is relevant or not, but I do not seem to have two of these installed in my eclipse features directory.  Specifically, org.eclipse.equinox.p2.sdk and org.eclipse.core.runtime.feature are nowhere to be found.  I checked the luna update sites and don't see anything that I neglected to install.  Are these two missing features somehow breaking the export wizard?
Comment 11 Gary C CLA 2014-07-02 13:58:14 EDT
I would suggest that if developers are unable use the product export wizard for their RCP applications, then this is a rather critical bug and should not be deferred until the next major release (4.5).  It should be a priority to get it fixed in 4.4.1.
Comment 12 Curtis Windatt CLA 2014-07-02 14:03:33 EDT
(In reply to Gary C from comment #11)
> I would suggest that if developers are unable use the product export wizard
> for their RCP applications, then this is a rather critical bug and should
> not be deferred until the next major release (4.5).  It should be a priority
> to get it fixed in 4.4.1.

Yes, depending on what the fix looks like, it should be backported to 4.4.1.
Comment 13 Kenneth Evans CLA 2014-07-11 13:42:23 EDT
Bug 438493, which has been marked as a duplicate of this bug, seems to be somewhat different, even though it also involves a NullPointerException.  The stack trace is different and no features are involved.

This bug keeps me from deploying any of my RCP applications, which is serious.  Hopefully it will get fixed as soon as possible and at least in 4.4.1.
Comment 14 Andy Thomas-Cramer CLA 2014-07-22 15:20:37 EDT
The bug below, closed as a duplicate of this bug, offers a recipe for reproducing this defect. 

    Bug 427523 - PDE headless product build NPE when used with multi-os spec Bundle-NativeCode.

We had such multi-os BundleNativeCode entries in the similar case I filed in bug 440154.
Comment 15 Kenneth Evans CLA 2014-08-05 20:35:34 EDT
No one seems to be working on this.  Is Bug 438652 related?

It also has a NullPointerException involving the line:

org.eclipse.osgi.internal.module.ResolverImpl.isResolvable(ResolverImpl.java:285)

and involves Exporting.
Comment 16 Vikas Chandra CLA 2014-08-06 02:52:17 EDT
This is planned for 441 and I will look at it for 4.4.1 and port to 4.5
Comment 17 Vikas Chandra CLA 2014-08-11 09:59:50 EDT
Can you please attach the feature the export of which is currently not working?
Comment 18 Vikas Chandra CLA 2014-08-20 11:29:55 EDT
With the information I have, I cant recreate this. If there are any issues, please attach the relevant project and provide steps to recreate it.

Please feel free to reopen this with project file + steps.
Comment 19 Curtis Windatt CLA 2014-08-20 11:38:46 EDT
Reopening as there have been 3 duplicates as well as a blocking bug.  Clearly this is happening.  Did you check the other duplicates for steps to reproduce?
Comment 20 Gary C CLA 2014-08-20 11:49:52 EDT
(In reply to Vikas Chandra from comment #18)
> With the information I have, I cant recreate this. If there are any issues,
> please attach the relevant project and provide steps to recreate it.
> 
> Please feel free to reopen this with project file + steps.

I can't attach my project because it contains proprietary information, but it is an RCP application originally created with Eclipse 3.7.  It has not been migrated to the new e4 tools, so I am using the compatibility layer.  Also, I use the 64-bit version of Java 1.7, and the 64-bit Windows version of Eclipse.  I am able to use the product export wizard in Eclipse 4.3, but I cannot use it in Eclipse 4.4 due to this issue.
Comment 21 Stephan Wahlbrink CLA 2014-08-21 04:04:16 EDT
To reproduce the bug, you need a plugin using Bundle-NativeCode in the manifest file.

As already written in other comments, the 'platformOS' in org.eclipse.osgi.internal.resolver.NativeCodeSpecificationImpl.isSatisfiedBy can be null:

For example the 'platformProp'=
{   org.osgi.framework.executionenvironment=OSGi/Minimum-1.0,OSGi/Minimum-1.1,CDC-1.0/Foundation-1.0,
    org.osgi.framework.system.packages=javax.microedition.io }

has no entry for OS_NAME (org.osgi.framework.os.name), so 'platformOS'= null.

The code in isSatisfiedBy does not check for null => NPE in line 88
Comment 22 Vikas Chandra CLA 2014-08-26 07:12:55 EDT
In NativeCodeSpecificationImpl

line 112 should be modified from

platformProcessorAliases = Collections.singletonList(platformProcessor);

to

platformProcessorAliases = platformProcessor == null ? Collections.emptyList() : Collections.singleton(platformProcessor);

This change is already there in 4.5. It needs to ported back to 4.4.1

Also for 64 bit eclipse, processor=x86_64 should be used.
Comment 23 Vikas Chandra CLA 2014-08-26 07:22:28 EDT
Created attachment 246353 [details]
Project to recreate

To recreate ( on 64 bit eclipse only)

1) Import npe.zip
2) Open feature.xml in project FP
3) On overview page, click on Export Wizard in export section.

NPE as mentioned on this bug will be recreated.
Comment 24 Thomas Watson CLA 2014-08-26 08:38:19 EDT
(In reply to Vikas Chandra from comment #22)
> In NativeCodeSpecificationImpl
> 
> line 112 should be modified from
> 
> platformProcessorAliases = Collections.singletonList(platformProcessor);
> 
> to
> 
> platformProcessorAliases = platformProcessor == null ?
> Collections.emptyList() : Collections.singleton(platformProcessor);
> 
> This change is already there in 4.5. It needs to ported back to 4.4.1
> 
> Also for 64 bit eclipse, processor=x86_64 should be used.

Has anyone tried to reproduce this on the latest SR1 build?  This has already been fixed in SR1 with bug 438652.
Comment 25 Vikas Chandra CLA 2014-08-26 09:55:58 EDT
See previous comment. It is fixed. Verified in
eclipse-standard-luna-SR1-RC1-win32-x86_64

*** This bug has been marked as a duplicate of bug 438652 ***
Comment 26 Kenneth Evans CLA 2014-10-01 16:29:15 EDT
Seems to be working in 4.4.1.  Thanks.