[ 
https://issues.apache.org/jira/browse/NETBEANS-2905?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16905267#comment-16905267
 ] 

Tobias Fernandez edited comment on NETBEANS-2905 at 8/12/19 2:45 PM:
---------------------------------------------------------------------

Beside other changes, I did the following change to 
CollectLibrariesNodeVisitor.java at the very beginning of my research:

 
{noformat}
@@ -123,7 +127,13 @@ public class CollectLibrariesNodeVisitor
             if ( depExaminator == null )
             {
                 depExaminator = new ExamineManifest( log );
-                depExaminator.setArtifactFile( artifact.getFile() );
+                File file = artifact.getFile();
+                if (file != null) {
+                  depExaminator.setArtifactFile( file );
+                } else {
+                  log.warn( "Artifact's file is null: " + artifact.getId() );
+                  return false;
+                }
                 depExaminator.checkFile();
                 examinerCache.put( artifact, depExaminator );
             }{noformat}
 

Meanwhile our jenkins has produced a few(!) failed builds, containing following 
maven log:

 
{noformat}
[WARNING] Artifact's file is null: ***DEPENDENCY ARTIFACT 1***
[WARNING] Artifact's file is null: ***DEPENDENCY ARTIFACT 2***
[...]
[ERROR] Failed to execute goal 
org.apache.netbeans.utilities:nbm-maven-plugin:4.2-OWN:manifest 
(default-manifest) on project ***ARTIFACT***: Uncategorized problems with 
NetBeans dependency verification (maybe MNBMODULE-102 or wrong maven dependency 
metadata). Supposedly external classes are used in the project's binaries but 
the classes are not found on classpath. Class usages: [***2 CLASSES FROM 
DEPENDENCY ARTIFACT 2***] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal 
org.apache.netbeans.utilities:nbm-maven-plugin:4.2-OWN:manifest 
(default-manifest) on project ***ARTIFACT***: Uncategorized problems with 
NetBeans dependency verification (maybe MNBMODULE-102 or wrong maven dependency 
metadata). Supposedly external classes are used in the project's binaries but 
the classes are not found on classpath. Class usages: [***2 CLASSES FROM 
DEPENDENCY ARTIFACT 2***]{noformat}
The "DEPENDENCY ARTIFACT 1/2" are a sub-modules within same multi-module 
project,which have been built successfully just before the "ARTIFACT" module 
(latter is the failing one).

*Note:* 4.2-OWN is our branched version of the 4.2 release


was (Author: tobiasf):
Beside other changes, I did the following change to 
CollectLibrariesNodeVisitor.java at the very beginning of my research:

 
{noformat}
@@ -123,7 +127,13 @@ public class CollectLibrariesNodeVisitor
             if ( depExaminator == null )
             {
                 depExaminator = new ExamineManifest( log );
-                depExaminator.setArtifactFile( artifact.getFile() );
+                File file = artifact.getFile();
+                if (file != null) {
+                  depExaminator.setArtifactFile( file );
+                } else {
+                  log.warn( "Artifact's file is null: " + artifact.getId() );
+                  return false;
+                }
                 depExaminator.checkFile();
                 examinerCache.put( artifact, depExaminator );
             }{noformat}
 

Meanwhile our jenkins has produced a few(!) failed builds, containing following 
maven log:

 
{noformat}
[WARNING] Artifact's file is null: ***DEPENDENCY ARTIFACT 1***
[WARNING] Artifact's file is null: ***DEPENDENCY ARTIFACT 2***
[...]
[ERROR] Failed to execute goal 
org.apache.netbeans.utilities:nbm-maven-plugin:4.2-OWN:manifest 
(default-manifest) on project ***ARTIFACT***: Uncategorized problems with 
NetBeans dependency verification (maybe MNBMODULE-102 or wrong maven dependency 
metadata). Supposedly external classes are used in the project's binaries but 
the classes are not found on classpath. Class usages: [***2 CLASSES FROM 
DEPENDENCY ARTIFACT 2***] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal 
org.apache.netbeans.utilities:nbm-maven-plugin:4.2-OWN:manifest 
(default-manifest) on project ***ARTIFACT***: Uncategorized problems with 
NetBeans dependency verification (maybe MNBMODULE-102 or wrong maven dependency 
metadata). Supposedly external classes are used in the project's binaries but 
the classes are not found on classpath. Class usages: [***2 CLASSES FROM 
DEPENDENCY ARTIFACT 2***]{noformat}
The "DEPENDENCY ARTIFACT 1/2" are a sub-modules within same multi-module 
project,which have been built successfully just before the "ARTIFACT" module 
(latter is the failing one).

 

> nbm-maven-plugin fails with NPE
> -------------------------------
>
>                 Key: NETBEANS-2905
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-2905
>             Project: NetBeans
>          Issue Type: Bug
>          Components: apisupport - Maven
>            Reporter: Tobias Fernandez
>            Priority: Major
>
> Several projects sometimes (not always!) fail during 
> npe-maven-plugin:manifest with a NullPointerException. The root cause is 
> probably a null value retrieved from Artifact.getFile(), which doesn't seem 
> to be a foreseen case in nbm-maven-plugin in multiple code locations.
> {code:java}
> [ERROR] Failed to execute goal 
> org.apache.netbeans.utilities:nbm-maven-plugin:4.2:manifest 
> (default-manifest) on project mapsupport: Execution default-manifest of goal 
> org.apache.netbeans.utilities:nbm-maven-plugin:4.2:manifest failed. 
> NullPointerException -> [Help 1]
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute 
> goal org.apache.netbeans.utilities:nbm-maven-plugin:4.2:manifest 
> (default-manifest) on project mapsupport: Execution default-manifest of goal 
> org.apache.netbeans.utilities:nbm-maven-plugin:4.2:manifest failed.
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:215)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:156)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:148)
>     at 
> org.apache.maven.lifecycle.internal.MojoExecutor.executeForkedExecutions 
> (MojoExecutor.java:355)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:200)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:156)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:148)
>     at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
> (LifecycleModuleBuilder.java:117)
>     at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
> (LifecycleModuleBuilder.java:81)
>     at 
> org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build
>  (SingleThreadedBuilder.java:56)
>     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute 
> (LifecycleStarter.java:128)
>     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
>     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
>     at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
>     at org.jvnet.hudson.maven3.launcher.Maven35Launcher.main 
> (Maven35Launcher.java:130)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke 
> (NativeMethodAccessorImpl.java:62)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke 
> (DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke (Method.java:498)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced 
> (Launcher.java:289)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.launch 
> (Launcher.java:229)
>     at jenkins.maven3.agent.Maven35Main.launch (Maven35Main.java:178)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke 
> (NativeMethodAccessorImpl.java:62)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke 
> (DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke (Method.java:498)
>     at hudson.maven.Maven3Builder.call (Maven3Builder.java:139)
>     at hudson.maven.Maven3Builder.call (Maven3Builder.java:70)
>     at hudson.remoting.UserRequest.perform (UserRequest.java:212)
>     at hudson.remoting.UserRequest.perform (UserRequest.java:54)
>     at hudson.remoting.Request$2.run (Request.java:369)
>     at hudson.remoting.InterceptingExecutorService$1.call 
> (InterceptingExecutorService.java:72)
>     at java.util.concurrent.FutureTask.run (FutureTask.java:266)
>     at java.util.concurrent.ThreadPoolExecutor.runWorker 
> (ThreadPoolExecutor.java:1149)
>     at java.util.concurrent.ThreadPoolExecutor$Worker.run 
> (ThreadPoolExecutor.java:624)
>     at java.lang.Thread.run (Thread.java:748)
> Caused by: org.apache.maven.plugin.PluginExecutionException: Execution 
> default-manifest of goal 
> org.apache.netbeans.utilities:nbm-maven-plugin:4.2:manifest failed.
>     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo 
> (DefaultBuildPluginManager.java:148)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:210)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:156)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:148)
>     at 
> org.apache.maven.lifecycle.internal.MojoExecutor.executeForkedExecutions 
> (MojoExecutor.java:355)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:200)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:156)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:148)
>     at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
> (LifecycleModuleBuilder.java:117)
>     at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
> (LifecycleModuleBuilder.java:81)
>     at 
> org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build
>  (SingleThreadedBuilder.java:56)
>     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute 
> (LifecycleStarter.java:128)
>     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
>     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
>     at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
>     at org.jvnet.hudson.maven3.launcher.Maven35Launcher.main 
> (Maven35Launcher.java:130)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke 
> (NativeMethodAccessorImpl.java:62)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke 
> (DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke (Method.java:498)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced 
> (Launcher.java:289)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.launch 
> (Launcher.java:229)
>     at jenkins.maven3.agent.Maven35Main.launch (Maven35Main.java:178)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke 
> (NativeMethodAccessorImpl.java:62)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke 
> (DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke (Method.java:498)
>     at hudson.maven.Maven3Builder.call (Maven3Builder.java:139)
>     at hudson.maven.Maven3Builder.call (Maven3Builder.java:70)
>     at hudson.remoting.UserRequest.perform (UserRequest.java:212)
>     at hudson.remoting.UserRequest.perform (UserRequest.java:54)
>     at hudson.remoting.Request$2.run (Request.java:369)
>     at hudson.remoting.InterceptingExecutorService$1.call 
> (InterceptingExecutorService.java:72)
>     at java.util.concurrent.FutureTask.run (FutureTask.java:266)
>     at java.util.concurrent.ThreadPoolExecutor.runWorker 
> (ThreadPoolExecutor.java:1149)
>     at java.util.concurrent.ThreadPoolExecutor$Worker.run 
> (ThreadPoolExecutor.java:624)
>     at java.lang.Thread.run (Thread.java:748)
> Caused by: java.lang.NullPointerException
>     at org.apache.netbeans.nbm.utils.ExamineManifest.setArtifactFile 
> (ExamineManifest.java:375)
>     at org.apache.netbeans.nbm.CollectLibrariesNodeVisitor.visit 
> (CollectLibrariesNodeVisitor.java:126)
>     at 
> org.apache.maven.shared.dependency.graph.internal.DefaultDependencyNode.accept
>  (DefaultDependencyNode.java:73)
>     at 
> org.apache.maven.shared.dependency.graph.internal.DefaultDependencyNode.accept
>  (DefaultDependencyNode.java:77)
>     at org.apache.netbeans.nbm.AbstractNbmMojo.getLibraryArtifacts 
> (AbstractNbmMojo.java:205)
>     at org.apache.netbeans.nbm.NetBeansManifestUpdateMojo.execute 
> (NetBeansManifestUpdateMojo.java:461)
>     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo 
> (DefaultBuildPluginManager.java:137)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:210)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:156)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:148)
>     at 
> org.apache.maven.lifecycle.internal.MojoExecutor.executeForkedExecutions 
> (MojoExecutor.java:355)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:200)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:156)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:148)
>     at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
> (LifecycleModuleBuilder.java:117)
>     at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
> (LifecycleModuleBuilder.java:81)
>     at 
> org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build
>  (SingleThreadedBuilder.java:56)
>     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute 
> (LifecycleStarter.java:128)
>     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
>     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
>     at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
>     at org.jvnet.hudson.maven3.launcher.Maven35Launcher.main 
> (Maven35Launcher.java:130)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke 
> (NativeMethodAccessorImpl.java:62)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke 
> (DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke (Method.java:498)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced 
> (Launcher.java:289)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.launch 
> (Launcher.java:229)
>     at jenkins.maven3.agent.Maven35Main.launch (Maven35Main.java:178)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke 
> (NativeMethodAccessorImpl.java:62)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke 
> (DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke (Method.java:498)
>     at hudson.maven.Maven3Builder.call (Maven3Builder.java:139)
>     at hudson.maven.Maven3Builder.call (Maven3Builder.java:70)
>     at hudson.remoting.UserRequest.perform (UserRequest.java:212)
>     at hudson.remoting.UserRequest.perform (UserRequest.java:54)
>     at hudson.remoting.Request$2.run (Request.java:369)
>     at hudson.remoting.InterceptingExecutorService$1.call 
> (InterceptingExecutorService.java:72)
>     at java.util.concurrent.FutureTask.run (FutureTask.java:266)
>     at java.util.concurrent.ThreadPoolExecutor.runWorker 
> (ThreadPoolExecutor.java:1149)
>     at java.util.concurrent.ThreadPoolExecutor$Worker.run 
> (ThreadPoolExecutor.java:624)
>     at java.lang.Thread.run (Thread.java:748)
> [ERROR]{code}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to