Community
Participate
Working Groups
F2 I'm seeing an NPE on startup caused by duplicate attribute in a feature.xml file *in the workspace*. The feature.xml was built by hand, and is in a project that is not marked as belonging to PDE (CVS project org.eclipse.platform.aix.motif-feature in dev.eclipse.org). The feature.xml had: <feature id="org.eclipse.platform.aix.motif" label="%featureName" version="2.0.0" image= "eclipse32.gif" provider-name="%providerName" os="aix" ws="motif" image= "eclipse32.gif"> The log is attached. The NPE result in the pde.core and pde.ui plug-ins being deactivated. Then all hell breaks loose from the user's point of view.
Created attachment 1293 [details] log showing repeated and rippling failures
Are you sure this is caused by the duplicate attribute? The NPE is related to the included feature (when PDE cannot find it in the workspace).
Actually, that is exactly the problem. Here is the sequence of events: 1) You had a child feature with an error (duplicate attribute). 2) You didn't create the feature project with PDE so you didn't have feature nature. 3) As a result of that, you didn't have feature builder to create an error marker for the syntax error. 4) You probably left the parent feature editor open. 5) When loading the model, it tried to connect to the child feature model. 6) Becuase child feature model failed to load due to errors, its 'feature' root element was null. 7) PDE called 'getId' on a null object. BOOM. I fixed the 'null' call to avoid the cascade failures. In your own interest, you should consider adding the PDE nature and builder to the '.project' file of the feature. It isn't hard: create one dummy feature project using PDE and inspect the content of the .project file. You will see the entries for the nature and builder. Here is an example: <?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>com.example.child</name> <comment></comment> <projects> </projects> <buildSpec> <buildCommand> <name>org.eclipse.jdt.core.javabuilder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.eclipse.pde.FeatureBuilder</name> <arguments> </arguments> </buildCommand> </buildSpec> <natures> <nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.pde.FeatureNature</nature> </natures> </projectDescription> You need to add 'buildCommand' an 'nature' elements.
It does not make sense to me to add the Java nature to feature projects in general (they contain no Java code whatsoever.) Can the feature nature be added by itself?
Actually, it does make sense because features may contain install handlers which are written in Java. In addition, having a Java nature makes the project visible in the Packages view.