Uploaded image for project: 'Bamboo Artifactory Plug-in'
  1. Bamboo Artifactory Plug-in
  2. BAP-26

Maven 3 builder fails with null pointer exception.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 1.0.2
    • Fix Version/s: 1.0.3
    • 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

        Attachments

          Activity

            People

            • Assignee:
              noam.tenne Noam Y. Tenne (Inactive)
              Reporter:
              alexjfisher Alexander Fisher
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: