You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Johns (JIRA)" <ji...@codehaus.org> on 2008/04/04 18:51:58 UTC
[jira] Created: (MECLIPSE-423) NullPointerException when existing
Manifest.MF file has no Class-Path element
NullPointerException when existing Manifest.MF file has no Class-Path element
-----------------------------------------------------------------------------
Key: MECLIPSE-423
URL: http://jira.codehaus.org/browse/MECLIPSE-423
Project: Maven 2.x Eclipse Plugin
Issue Type: Bug
Affects Versions: 2.5
Reporter: Michael Johns
Priority: Minor
A NullPointerException arises when running the rad goal against a project containing a manifest that has no Class-Path element. The exception is caught and the only error on the screen is "No <project-path>\META-INF\MANIFEST.MF file found". The problem is in the RadManifestWriter.orderClasspath() method. It needs to check newValue for null before trying to split it up.
Here's the manifest I had that caused the problem:
{code}
Manifest-Version: 1.0
Build-Jdk: 1.4.2
Built-By: Michael Johns
Created-By: Apache Maven
{code}
Notice that it has no Class-Path element.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MECLIPSE-423) NullPointerException when existing
Manifest.MF file has no Class-Path element
Posted by "Michael Johns (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MECLIPSE-423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=155289#action_155289 ]
Michael Johns commented on MECLIPSE-423:
----------------------------------------
Barrie, I pulled down the source and had a look at the changes. Strictly regarding the originally filed issue, you made the exact same change I did in my locally patched version, so I feel confident that you've fixed the problem.
As for the bigger change of refactoring code up to a parent class... I think that's a good change, if a bit outside the scope of this issue. I'll leave it to others to judge whether or not it's a proper change. I'm really only qualified to judge the fix for the issue as I filed it.
> NullPointerException when existing Manifest.MF file has no Class-Path element
> -----------------------------------------------------------------------------
>
> Key: MECLIPSE-423
> URL: http://jira.codehaus.org/browse/MECLIPSE-423
> Project: Maven 2.x Eclipse Plugin
> Issue Type: Bug
> Components: Core : Dependencies resolution and build path (.classpath)
> Affects Versions: 2.5
> Reporter: Michael Johns
> Assignee: Barrie Treloar
> Priority: Minor
> Fix For: 2.6
>
> Attachments: pom.xml
>
>
> A NullPointerException arises when running the rad goal against a project containing a manifest that has no Class-Path element. The exception is caught and the only error on the screen is "No <project-path>\META-INF\MANIFEST.MF file found". The problem is in the RadManifestWriter.orderClasspath() method. It needs to check newValue for null before trying to split it up.
> Here's the manifest I had that caused the problem:
> {code}
> Manifest-Version: 1.0
> Build-Jdk: 1.4.2
> Built-By: Michael Johns
> Created-By: Apache Maven
> {code}
> Notice that it has no Class-Path element.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (MECLIPSE-423) NullPointerException when existing
Manifest.MF file has no Class-Path element
Posted by "Barrie Treloar (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MECLIPSE-423?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Barrie Treloar updated MECLIPSE-423:
------------------------------------
Assignee: Barrie Treloar
Fix Version/s: 2.6
EclipseManifestWriter and RadManifestWriter are a cut-and-paste. Created AbstractEclipseManifestWriter as shared parent class
and moved all the common stuff up. Where the code varied EclipseManifestWriter's implementation was chosen. This was because the variation was often a bug fix.
The only variation that could not be easily sorted was in addDependencyToClassPath where they only differ at the end:
EclipseManifestWriter:
classpath.append( dependency.getEclipseProjectName() + ".jar" );
RadManifestWriter
classpath.append( dependency.getArtifactId() + ".jar" );
I have taken the eclipse one as being correct and changed RadPlugin to override getProjectNameForArifact() to return artifact.getArtifactId() to match RadManifestWriter dependency.getArtifactId() as above. Integration tests still work but I need a RAD person to validate this for me.
Added testProject8 for IT test. Prior to patch this exercised the defect. After the patch it looks like it is fixed.
However have asked for clarifiction about write() when a new MANIFEST.MF needs to be written but there is already an existing file.
See http://www.nabble.com/m-eclipse-p%3A-EclipseManifestWriter.write%28%29---doesn%27t-retain-any-keys-except-CLASS_PATH-and-MANIFEST_VERSION-td19546126.html
The problem is that the old values will be lost. Need to check if that is the correct intention.
Michael, can you please try this in your RAD environment. I can't guarantee that the refactoring done works as the ITs are sparse in this area.
> NullPointerException when existing Manifest.MF file has no Class-Path element
> -----------------------------------------------------------------------------
>
> Key: MECLIPSE-423
> URL: http://jira.codehaus.org/browse/MECLIPSE-423
> Project: Maven 2.x Eclipse Plugin
> Issue Type: Bug
> Affects Versions: 2.5
> Reporter: Michael Johns
> Assignee: Barrie Treloar
> Priority: Minor
> Fix For: 2.6
>
> Attachments: pom.xml
>
>
> A NullPointerException arises when running the rad goal against a project containing a manifest that has no Class-Path element. The exception is caught and the only error on the screen is "No <project-path>\META-INF\MANIFEST.MF file found". The problem is in the RadManifestWriter.orderClasspath() method. It needs to check newValue for null before trying to split it up.
> Here's the manifest I had that caused the problem:
> {code}
> Manifest-Version: 1.0
> Build-Jdk: 1.4.2
> Built-By: Michael Johns
> Created-By: Apache Maven
> {code}
> Notice that it has no Class-Path element.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (MECLIPSE-423) NullPointerException when existing
Manifest.MF file has no Class-Path element
Posted by "Arnaud Heritier (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MECLIPSE-423?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Arnaud Heritier updated MECLIPSE-423:
-------------------------------------
Component/s: Core : Dependencies resolution and build path (.classpath)
> NullPointerException when existing Manifest.MF file has no Class-Path element
> -----------------------------------------------------------------------------
>
> Key: MECLIPSE-423
> URL: http://jira.codehaus.org/browse/MECLIPSE-423
> Project: Maven 2.x Eclipse Plugin
> Issue Type: Bug
> Components: Core : Dependencies resolution and build path (.classpath)
> Affects Versions: 2.5
> Reporter: Michael Johns
> Assignee: Barrie Treloar
> Priority: Minor
> Fix For: 2.6
>
> Attachments: pom.xml
>
>
> A NullPointerException arises when running the rad goal against a project containing a manifest that has no Class-Path element. The exception is caught and the only error on the screen is "No <project-path>\META-INF\MANIFEST.MF file found". The problem is in the RadManifestWriter.orderClasspath() method. It needs to check newValue for null before trying to split it up.
> Here's the manifest I had that caused the problem:
> {code}
> Manifest-Version: 1.0
> Build-Jdk: 1.4.2
> Built-By: Michael Johns
> Created-By: Apache Maven
> {code}
> Notice that it has no Class-Path element.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Closed: (MECLIPSE-423) NullPointerException when existing
Manifest.MF file has no Class-Path element
Posted by "Barrie Treloar (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MECLIPSE-423?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Barrie Treloar closed MECLIPSE-423.
-----------------------------------
Resolution: Fixed
Thanks Michael.
The refactored code made some minor changes to the RAD code base because they were not strictcly identical.
But I felt that what was in the RAD code was out of date/sync with the base one and hence probably should be changed.
If you are saying that HEAD is working then those refactoring changes didn't break for RAD.
Closing issue.
> NullPointerException when existing Manifest.MF file has no Class-Path element
> -----------------------------------------------------------------------------
>
> Key: MECLIPSE-423
> URL: http://jira.codehaus.org/browse/MECLIPSE-423
> Project: Maven 2.x Eclipse Plugin
> Issue Type: Bug
> Components: Core : Dependencies resolution and build path (.classpath)
> Affects Versions: 2.5
> Reporter: Michael Johns
> Assignee: Barrie Treloar
> Priority: Minor
> Fix For: 2.6
>
> Attachments: pom.xml
>
>
> A NullPointerException arises when running the rad goal against a project containing a manifest that has no Class-Path element. The exception is caught and the only error on the screen is "No <project-path>\META-INF\MANIFEST.MF file found". The problem is in the RadManifestWriter.orderClasspath() method. It needs to check newValue for null before trying to split it up.
> Here's the manifest I had that caused the problem:
> {code}
> Manifest-Version: 1.0
> Build-Jdk: 1.4.2
> Built-By: Michael Johns
> Created-By: Apache Maven
> {code}
> Notice that it has no Class-Path element.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (MECLIPSE-423) NullPointerException when existing
Manifest.MF file has no Class-Path element
Posted by "Michael Johns (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MECLIPSE-423?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Johns updated MECLIPSE-423:
-----------------------------------
Attachment: pom.xml
POM file for offending project. Note that this is by far the most complicated POM we have for any of our projects. It's because it is for a WBI project developed in IBM's WID. WID wants the directory structure to be just right, and unlike Maven, it's not flexible on that at all. So we have to bend Maven to the wishes of WID.
But I don't think you really need to duplicate my project. Just create a MANIFEST that has no Class-Path element for _any_ project, and then run the plugin.
> NullPointerException when existing Manifest.MF file has no Class-Path element
> -----------------------------------------------------------------------------
>
> Key: MECLIPSE-423
> URL: http://jira.codehaus.org/browse/MECLIPSE-423
> Project: Maven 2.x Eclipse Plugin
> Issue Type: Bug
> Affects Versions: 2.5
> Reporter: Michael Johns
> Priority: Minor
> Attachments: pom.xml
>
>
> A NullPointerException arises when running the rad goal against a project containing a manifest that has no Class-Path element. The exception is caught and the only error on the screen is "No <project-path>\META-INF\MANIFEST.MF file found". The problem is in the RadManifestWriter.orderClasspath() method. It needs to check newValue for null before trying to split it up.
> Here's the manifest I had that caused the problem:
> {code}
> Manifest-Version: 1.0
> Build-Jdk: 1.4.2
> Built-By: Michael Johns
> Created-By: Apache Maven
> {code}
> Notice that it has no Class-Path element.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MECLIPSE-423) NullPointerException when existing
Manifest.MF file has no Class-Path element
Posted by "Arnaud Heritier (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MECLIPSE-423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=129860#action_129860 ]
Arnaud Heritier commented on MECLIPSE-423:
------------------------------------------
Can you give us a sample of your pom settings to help us to reproduce it. thx. cheers.
> NullPointerException when existing Manifest.MF file has no Class-Path element
> -----------------------------------------------------------------------------
>
> Key: MECLIPSE-423
> URL: http://jira.codehaus.org/browse/MECLIPSE-423
> Project: Maven 2.x Eclipse Plugin
> Issue Type: Bug
> Affects Versions: 2.5
> Reporter: Michael Johns
> Priority: Minor
>
> A NullPointerException arises when running the rad goal against a project containing a manifest that has no Class-Path element. The exception is caught and the only error on the screen is "No <project-path>\META-INF\MANIFEST.MF file found". The problem is in the RadManifestWriter.orderClasspath() method. It needs to check newValue for null before trying to split it up.
> Here's the manifest I had that caused the problem:
> {code}
> Manifest-Version: 1.0
> Build-Jdk: 1.4.2
> Built-By: Michael Johns
> Created-By: Apache Maven
> {code}
> Notice that it has no Class-Path element.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Work started: (MECLIPSE-423) NullPointerException when
existing Manifest.MF file has no Class-Path element
Posted by "Barrie Treloar (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MECLIPSE-423?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Work on MECLIPSE-423 started by Barrie Treloar.
> NullPointerException when existing Manifest.MF file has no Class-Path element
> -----------------------------------------------------------------------------
>
> Key: MECLIPSE-423
> URL: http://jira.codehaus.org/browse/MECLIPSE-423
> Project: Maven 2.x Eclipse Plugin
> Issue Type: Bug
> Affects Versions: 2.5
> Reporter: Michael Johns
> Assignee: Barrie Treloar
> Priority: Minor
> Fix For: 2.6
>
> Attachments: pom.xml
>
>
> A NullPointerException arises when running the rad goal against a project containing a manifest that has no Class-Path element. The exception is caught and the only error on the screen is "No <project-path>\META-INF\MANIFEST.MF file found". The problem is in the RadManifestWriter.orderClasspath() method. It needs to check newValue for null before trying to split it up.
> Here's the manifest I had that caused the problem:
> {code}
> Manifest-Version: 1.0
> Build-Jdk: 1.4.2
> Built-By: Michael Johns
> Created-By: Apache Maven
> {code}
> Notice that it has no Class-Path element.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MECLIPSE-423) NullPointerException when existing
Manifest.MF file has no Class-Path element
Posted by "Michael Johns (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MECLIPSE-423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=130507#action_130507 ]
Michael Johns commented on MECLIPSE-423:
----------------------------------------
You'll also notice in the POM that we're using a custom version of the eclipse plugin. Our version is 99% the same as the original; it just has a bug fix or two (including this one). We'd like to get off of our custom version, though, but we can't until these types of issues are fixed.
> NullPointerException when existing Manifest.MF file has no Class-Path element
> -----------------------------------------------------------------------------
>
> Key: MECLIPSE-423
> URL: http://jira.codehaus.org/browse/MECLIPSE-423
> Project: Maven 2.x Eclipse Plugin
> Issue Type: Bug
> Affects Versions: 2.5
> Reporter: Michael Johns
> Priority: Minor
> Attachments: pom.xml
>
>
> A NullPointerException arises when running the rad goal against a project containing a manifest that has no Class-Path element. The exception is caught and the only error on the screen is "No <project-path>\META-INF\MANIFEST.MF file found". The problem is in the RadManifestWriter.orderClasspath() method. It needs to check newValue for null before trying to split it up.
> Here's the manifest I had that caused the problem:
> {code}
> Manifest-Version: 1.0
> Build-Jdk: 1.4.2
> Built-By: Michael Johns
> Created-By: Apache Maven
> {code}
> Notice that it has no Class-Path element.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira