[BAP-26] Maven 3 builder fails with null pointer exception. Created: 20/Nov/10  Updated: 21/Nov/10  Resolved: 21/Nov/10

Status: Resolved
Project: Bamboo Artifactory Plug-in
Component/s: None
Affects Version/s: 1.0.2
Fix Version/s: 1.0.3

Type: Bug Priority: Normal
Reporter: Alexander Fisher Assignee: Noam Y. Tenne (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Environment:

Bamboo 2.7.1



 Description   
Failed to execute the build 'PROJECT-MAVEN3-JOB1-10'
java.lang.NullPointerException
        at java.util.Hashtable.put(Hashtable.java:394)
        at java.util.Properties.setProperty(Properties.java:143)
        at org.jfrog.bamboo.builder.ArtifactoryBuildInfoPropertyHelper.addBuilderInfoProperties(ArtifactoryBuildInfoPropertyHelper.java:161)
        at org.jfrog.bamboo.builder.ArtifactoryBuildInfoPropertyHelper.createFileAndGetPath(ArtifactoryBuildInfoPropertyHelper.java:93)
        at org.jfrog.bamboo.builder.ArtifactoryMaven3Builder.runBuild(ArtifactoryMaven3Builder.java:452)
        at com.atlassian.bamboo.builder.AbstractBuilder.executeBuild(AbstractBuilder.java:272)
        at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:85)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
        at org.springframework.orm.hibernate.HibernateInterceptor.invoke(HibernateInterceptor.java:117)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at $Proxy218.call(Unknown Source)
        at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:189)
        at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:90)
        at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:102)
        at com.atlassian.bamboo.build.pipeline.concurrent.NamedThreadFactory$2.run(NamedThreadFactory.java:50)
        at java.lang.Thread.run(Thread.java:619)

Failed to execute the build 'PROJECT-MAVEN3-JOB1-10': null

It appears that ManualBuildTriggerReason.getUserName() is returning null.
I'm currently trying the following work-around, but may file a bug at Atlassian.

--- src/main/java/org/jfrog/bamboo/builder/ArtifactoryBuildInfoPropertyHelper.java      (revision 1541)
+++ src/main/java/org/jfrog/bamboo/builder/ArtifactoryBuildInfoPropertyHelper.java      (working copy)
@@ -154,6 +154,11 @@
         } else {
             principal = "auto";
         }
+        if(principal == null)
+        {
+            log.error("ManualBuildTriggerReason.getUserName returned null.");
+            principal = "unknown";
+        }

         addBuildParentProperties(properties, triggerReason);

Cheers,
Alex



 Comments   
Comment by Alexander Fisher [ 20/Nov/10 ]

http://jira.atlassian.com/browse/BAM-7366

Generated at Thu Aug 22 04:39:04 UTC 2019 using JIRA 7.6.3#76005-sha1:8a4e38d34af948780dbf52044e7aafb13a7cae58.