You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Klaus Brunner (JIRA)" <ji...@codehaus.org> on 2008/08/01 13:49:26 UTC
[jira] Created: (MPIR-131) NPE in printArtifactsLocations() for
blacklisted repo
NPE in printArtifactsLocations() for blacklisted repo
-----------------------------------------------------
Key: MPIR-131
URL: http://jira.codehaus.org/browse/MPIR-131
Project: Maven 2.x Project Info Reports Plugin
Issue Type: Bug
Components: dependencies
Affects Versions: 2.1
Environment: Linux (Sun JDK 1.6), Windows (IBM VM 1.4). No direct Internet access; going through local Artifactory repository.
Reporter: Klaus Brunner
Priority: Critical
I'm getting NPEs when running the reports plugin at this location:
[INFO] Generating "Dependencies" report.
[WARNING] The repository url 'http://repo1.maven.org/maven2' is invalid - Repository 'central' will be blacklisted.
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] null
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.NullPointerException
at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.printArtifactsLocations(DependenciesRenderer.java:1182)
at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.renderSectionDependencyRepositoryLocations(DependenciesRenderer.java:641)
at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.renderBody(DependenciesRenderer.java:274)
at org.apache.maven.reporting.AbstractMavenReportRenderer.render(AbstractMavenReportRenderer.java:65)
at org.apache.maven.report.projectinfo.DependenciesReport.executeReport(DependenciesReport.java:239)
Taking a brief look with the debugger, it appears that the totalByRepo map in DependenciesRenderer.printArtifactsLocations() is empty - so looking up any entry will of course return null and result in an NPE here:
totalRow[idnum++] = totalByRepo.get( repokey ).toString();
Note that this used to work fine before the 2.1 release.
--
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: (MPIR-131) NPE in printArtifactsLocations() for
blacklisted repo
Posted by "Jörgen Rydenius (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MPIR-131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=151301#action_151301 ]
Jörgen Rydenius commented on MPIR-131:
--------------------------------------
I encountered the same problem. I do not think that blacklisted repositories are the problem, I think it is declared repositories that do not host *any* of the dependency artifacts. Blacklisted repositories are filtered out before reaching DependenciesRenderer.java:1182. I do not have a test case to provide, but suggest the following patch that completely solved this problem for me:
{{
Index: src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java
===================================================================
--- src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java (revision 706043)
+++ src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java (working copy)
@@ -1178,8 +1178,8 @@
for ( Iterator itrepo = repoIdList.iterator(); itrepo.hasNext(); )
{
String repokey = (String) itrepo.next();
-
- totalRow[idnum++] = totalByRepo.get( repokey ).toString();
+ Integer dependencies = (Integer) totalByRepo.get( repokey );
+ totalRow[idnum++] = dependencies != null ? dependencies.toString() : "0";
}
tableRow( totalRow );
}}
> NPE in printArtifactsLocations() for blacklisted repo
> -----------------------------------------------------
>
> Key: MPIR-131
> URL: http://jira.codehaus.org/browse/MPIR-131
> Project: Maven 2.x Project Info Reports Plugin
> Issue Type: Bug
> Components: dependencies
> Affects Versions: 2.1
> Environment: Linux (Sun JDK 1.6), Windows (IBM VM 1.4). No direct Internet access; going through local Artifactory repository.
> Reporter: Klaus Brunner
> Priority: Critical
>
> I'm getting NPEs when running the reports plugin at this location:
> [INFO] Generating "Dependencies" report.
> [WARNING] The repository url 'http://repo1.maven.org/maven2' is invalid - Repository 'central' will be blacklisted.
> [INFO] ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] null
> [INFO] ------------------------------------------------------------------------
> [INFO] Trace
> java.lang.NullPointerException
> at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.printArtifactsLocations(DependenciesRenderer.java:1182)
> at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.renderSectionDependencyRepositoryLocations(DependenciesRenderer.java:641)
> at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.renderBody(DependenciesRenderer.java:274)
> at org.apache.maven.reporting.AbstractMavenReportRenderer.render(AbstractMavenReportRenderer.java:65)
> at org.apache.maven.report.projectinfo.DependenciesReport.executeReport(DependenciesReport.java:239)
> Taking a brief look with the debugger, it appears that the totalByRepo map in DependenciesRenderer.printArtifactsLocations() is empty - so looking up any entry will of course return null and result in an NPE here:
> totalRow[idnum++] = totalByRepo.get( repokey ).toString();
> Note that this used to work fine before the 2.1 release.
--
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] Issue Comment Edited: (MPIR-131) NPE in
printArtifactsLocations() for blacklisted repo
Posted by "Jörgen Rydenius (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MPIR-131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=151301#action_151301 ]
rydenius edited comment on MPIR-131 at 10/19/08 3:59 PM:
----------------------------------------------------------------
I encountered the same problem. I do not think that blacklisted repositories are the problem, I think it is declared repositories that do not host *any* of the dependency artifacts. Blacklisted repositories are filtered out before reaching DependenciesRenderer.java:1182. I do not have a test case to provide, but suggest the following patch that completely solved this problem for me:
{code}
Index: src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java
===================================================================
--- src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java (revision 706043)
+++ src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java (working copy)
@@ -1178,8 +1178,8 @@
for ( Iterator itrepo = repoIdList.iterator(); itrepo.hasNext(); )
{
String repokey = (String) itrepo.next();
-
- totalRow[idnum++] = totalByRepo.get( repokey ).toString();
+ Integer dependencies = (Integer) totalByRepo.get( repokey );
+ totalRow[idnum++] = dependencies != null ? dependencies.toString() : "0";
}
tableRow( totalRow );
{code}
was (Author: rydenius):
I encountered the same problem. I do not think that blacklisted repositories are the problem, I think it is declared repositories that do not host *any* of the dependency artifacts. Blacklisted repositories are filtered out before reaching DependenciesRenderer.java:1182. I do not have a test case to provide, but suggest the following patch that completely solved this problem for me:
{{
Index: src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java
===================================================================
--- src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java (revision 706043)
+++ src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java (working copy)
@@ -1178,8 +1178,8 @@
for ( Iterator itrepo = repoIdList.iterator(); itrepo.hasNext(); )
{
String repokey = (String) itrepo.next();
-
- totalRow[idnum++] = totalByRepo.get( repokey ).toString();
+ Integer dependencies = (Integer) totalByRepo.get( repokey );
+ totalRow[idnum++] = dependencies != null ? dependencies.toString() : "0";
}
tableRow( totalRow );
}}
> NPE in printArtifactsLocations() for blacklisted repo
> -----------------------------------------------------
>
> Key: MPIR-131
> URL: http://jira.codehaus.org/browse/MPIR-131
> Project: Maven 2.x Project Info Reports Plugin
> Issue Type: Bug
> Components: dependencies
> Affects Versions: 2.1
> Environment: Linux (Sun JDK 1.6), Windows (IBM VM 1.4). No direct Internet access; going through local Artifactory repository.
> Reporter: Klaus Brunner
> Priority: Critical
>
> I'm getting NPEs when running the reports plugin at this location:
> [INFO] Generating "Dependencies" report.
> [WARNING] The repository url 'http://repo1.maven.org/maven2' is invalid - Repository 'central' will be blacklisted.
> [INFO] ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] null
> [INFO] ------------------------------------------------------------------------
> [INFO] Trace
> java.lang.NullPointerException
> at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.printArtifactsLocations(DependenciesRenderer.java:1182)
> at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.renderSectionDependencyRepositoryLocations(DependenciesRenderer.java:641)
> at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.renderBody(DependenciesRenderer.java:274)
> at org.apache.maven.reporting.AbstractMavenReportRenderer.render(AbstractMavenReportRenderer.java:65)
> at org.apache.maven.report.projectinfo.DependenciesReport.executeReport(DependenciesReport.java:239)
> Taking a brief look with the debugger, it appears that the totalByRepo map in DependenciesRenderer.printArtifactsLocations() is empty - so looking up any entry will of course return null and result in an NPE here:
> totalRow[idnum++] = totalByRepo.get( repokey ).toString();
> Note that this used to work fine before the 2.1 release.
--
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: (MPIR-131) NPE in printArtifactsLocations() for
blacklisted repo
Posted by "Thiago Leão Moreira (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MPIR-131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=163057#action_163057 ]
Thiago Leão Moreira commented on MPIR-131:
------------------------------------------
Or with a project without dependencies.
The patch provided by Jörgen Rydenius works perfectly.
> NPE in printArtifactsLocations() for blacklisted repo
> -----------------------------------------------------
>
> Key: MPIR-131
> URL: http://jira.codehaus.org/browse/MPIR-131
> Project: Maven 2.x Project Info Reports Plugin
> Issue Type: Bug
> Components: dependencies
> Affects Versions: 2.1
> Environment: Linux (Sun JDK 1.6), Windows (IBM VM 1.4). No direct Internet access; going through local Artifactory repository.
> Reporter: Klaus Brunner
> Priority: Critical
> Attachments: screenshot-1.jpg
>
>
> I'm getting NPEs when running the reports plugin at this location:
> [INFO] Generating "Dependencies" report.
> [WARNING] The repository url 'http://repo1.maven.org/maven2' is invalid - Repository 'central' will be blacklisted.
> [INFO] ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] null
> [INFO] ------------------------------------------------------------------------
> [INFO] Trace
> java.lang.NullPointerException
> at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.printArtifactsLocations(DependenciesRenderer.java:1182)
> at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.renderSectionDependencyRepositoryLocations(DependenciesRenderer.java:641)
> at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.renderBody(DependenciesRenderer.java:274)
> at org.apache.maven.reporting.AbstractMavenReportRenderer.render(AbstractMavenReportRenderer.java:65)
> at org.apache.maven.report.projectinfo.DependenciesReport.executeReport(DependenciesReport.java:239)
> Taking a brief look with the debugger, it appears that the totalByRepo map in DependenciesRenderer.printArtifactsLocations() is empty - so looking up any entry will of course return null and result in an NPE here:
> totalRow[idnum++] = totalByRepo.get( repokey ).toString();
> Note that this used to work fine before the 2.1 release.
--
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: (MPIR-131) NPE in printArtifactsLocations() for
blacklisted repo
Posted by "Thiago Leão Moreira (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MPIR-131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=163056#action_163056 ]
Thiago Leão Moreira commented on MPIR-131:
------------------------------------------
This issue is easy reproduced with a project where all the dependencies has the "system" scope.
> NPE in printArtifactsLocations() for blacklisted repo
> -----------------------------------------------------
>
> Key: MPIR-131
> URL: http://jira.codehaus.org/browse/MPIR-131
> Project: Maven 2.x Project Info Reports Plugin
> Issue Type: Bug
> Components: dependencies
> Affects Versions: 2.1
> Environment: Linux (Sun JDK 1.6), Windows (IBM VM 1.4). No direct Internet access; going through local Artifactory repository.
> Reporter: Klaus Brunner
> Priority: Critical
> Attachments: screenshot-1.jpg
>
>
> I'm getting NPEs when running the reports plugin at this location:
> [INFO] Generating "Dependencies" report.
> [WARNING] The repository url 'http://repo1.maven.org/maven2' is invalid - Repository 'central' will be blacklisted.
> [INFO] ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] null
> [INFO] ------------------------------------------------------------------------
> [INFO] Trace
> java.lang.NullPointerException
> at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.printArtifactsLocations(DependenciesRenderer.java:1182)
> at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.renderSectionDependencyRepositoryLocations(DependenciesRenderer.java:641)
> at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.renderBody(DependenciesRenderer.java:274)
> at org.apache.maven.reporting.AbstractMavenReportRenderer.render(AbstractMavenReportRenderer.java:65)
> at org.apache.maven.report.projectinfo.DependenciesReport.executeReport(DependenciesReport.java:239)
> Taking a brief look with the debugger, it appears that the totalByRepo map in DependenciesRenderer.printArtifactsLocations() is empty - so looking up any entry will of course return null and result in an NPE here:
> totalRow[idnum++] = totalByRepo.get( repokey ).toString();
> Note that this used to work fine before the 2.1 release.
--
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: (MPIR-131) NPE in printArtifactsLocations() for
blacklisted repo
Posted by "Vincent Siveton (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MPIR-131?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Vincent Siveton closed MPIR-131.
--------------------------------
Assignee: Vincent Siveton
Resolution: Fixed
Fix Version/s: 2.2
Fixed in [r738829|http://svn.apache.org/viewvc?rev=738829&view=rev], snapshot deployed. Thanks everybody!
> NPE in printArtifactsLocations() for blacklisted repo
> -----------------------------------------------------
>
> Key: MPIR-131
> URL: http://jira.codehaus.org/browse/MPIR-131
> Project: Maven 2.x Project Info Reports Plugin
> Issue Type: Bug
> Components: dependencies
> Affects Versions: 2.1
> Environment: Linux (Sun JDK 1.6), Windows (IBM VM 1.4). No direct Internet access; going through local Artifactory repository.
> Reporter: Klaus Brunner
> Assignee: Vincent Siveton
> Priority: Critical
> Fix For: 2.2
>
> Attachments: screenshot-1.jpg
>
>
> I'm getting NPEs when running the reports plugin at this location:
> [INFO] Generating "Dependencies" report.
> [WARNING] The repository url 'http://repo1.maven.org/maven2' is invalid - Repository 'central' will be blacklisted.
> [INFO] ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] null
> [INFO] ------------------------------------------------------------------------
> [INFO] Trace
> java.lang.NullPointerException
> at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.printArtifactsLocations(DependenciesRenderer.java:1182)
> at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.renderSectionDependencyRepositoryLocations(DependenciesRenderer.java:641)
> at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.renderBody(DependenciesRenderer.java:274)
> at org.apache.maven.reporting.AbstractMavenReportRenderer.render(AbstractMavenReportRenderer.java:65)
> at org.apache.maven.report.projectinfo.DependenciesReport.executeReport(DependenciesReport.java:239)
> Taking a brief look with the debugger, it appears that the totalByRepo map in DependenciesRenderer.printArtifactsLocations() is empty - so looking up any entry will of course return null and result in an NPE here:
> totalRow[idnum++] = totalByRepo.get( repokey ).toString();
> Note that this used to work fine before the 2.1 release.
--
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: (MPIR-131) NPE in printArtifactsLocations() for
blacklisted repo
Posted by "Vincent Siveton (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MPIR-131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=144012#action_144012 ]
Vincent Siveton commented on MPIR-131:
--------------------------------------
Could you provide us a test case?
> NPE in printArtifactsLocations() for blacklisted repo
> -----------------------------------------------------
>
> Key: MPIR-131
> URL: http://jira.codehaus.org/browse/MPIR-131
> Project: Maven 2.x Project Info Reports Plugin
> Issue Type: Bug
> Components: dependencies
> Affects Versions: 2.1
> Environment: Linux (Sun JDK 1.6), Windows (IBM VM 1.4). No direct Internet access; going through local Artifactory repository.
> Reporter: Klaus Brunner
> Priority: Critical
>
> I'm getting NPEs when running the reports plugin at this location:
> [INFO] Generating "Dependencies" report.
> [WARNING] The repository url 'http://repo1.maven.org/maven2' is invalid - Repository 'central' will be blacklisted.
> [INFO] ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] null
> [INFO] ------------------------------------------------------------------------
> [INFO] Trace
> java.lang.NullPointerException
> at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.printArtifactsLocations(DependenciesRenderer.java:1182)
> at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.renderSectionDependencyRepositoryLocations(DependenciesRenderer.java:641)
> at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.renderBody(DependenciesRenderer.java:274)
> at org.apache.maven.reporting.AbstractMavenReportRenderer.render(AbstractMavenReportRenderer.java:65)
> at org.apache.maven.report.projectinfo.DependenciesReport.executeReport(DependenciesReport.java:239)
> Taking a brief look with the debugger, it appears that the totalByRepo map in DependenciesRenderer.printArtifactsLocations() is empty - so looking up any entry will of course return null and result in an NPE here:
> totalRow[idnum++] = totalByRepo.get( repokey ).toString();
> Note that this used to work fine before the 2.1 release.
--
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