Bamboo java.lang.NullPointerException: Builder path is not defined
Asked by Frederick Bass:

I am getting this exception during my build of a java project. I am using Ant 1.8.2 and have ANT_HOME enviornment variable set as well as %ANT_HOME%\\bin on my Path environment variable. I'm using Windows 2008 R2. How is this bug resolved?

java.lang.NullPointerException: Builder path is not defined at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:204) at com.atlassian.bamboo.plugins.ant.task.AntConfig.\<init\>(AntConfig.java:66) at com.atlassian.bamboo.plugins.ant.task.AntBuildTask.execute(AntBuildTask.java:64) at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:183) at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:91) at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:85) at sun.reflect.GeneratedMethodAccessor608.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) 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.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy722.call(Unknown Source) at sun.reflect.GeneratedMethodAccessor608.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) 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 $Proxy723.call(Unknown Source) at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:204) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:103) at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:109) at com.atlassian.bamboo.build.pipeline.concurrent.NamedThreadFactory$2.run(NamedThreadFactory.java:52) at java.lang.Thread.run(Unknown Source)


Answers:
author: Michael Trostle
body: Suggestion above: "Faced same issue, but with Maven 3 on local build agent. Fixed by removing Maven 3 task and creating again same. Another fix - just open task and save it.

How to reproduce issue: change path to Maven 3 executable at server capabilities, it would break all existing tasks based on that builder."

I agree that opening and saving works sometimes, other times I had to create an exact duplicate of the current Maven 3.X task and delete the old one and it worked. It's apparently a bug that's been seen since version 5.6, I am seeing the issue on version 6.4.0. I don't know that it effects every task based on the builder, but I can't completely confirm otherwise as well.


author: bgreen-dt
body: I ran into this today as well when I was setting up some new agents. Frederick's suggestion of deleting and re-creating all Maven steps in the plan worked to fix it.

Later I discovered that disabling the task, running the build, and re-enabling the task worked as well.


author: Apt Team - Ramya Arvind
body: Faced same issue, but with Maven 3 on local build agent. Fixed by removing Maven 3 task and creation again same. Another fix - just open task and save it.

How to reproduce issue: change path to Maven 3 executable at server capabilities, it would break all existing tasks based on that builder.


author: ArmenA
body: Hi Freddy,

Are you using local or remote agents to build your plan? Can you please confirm that you have ANT [executable](https://confluence.atlassian.com/display/BAMBOO/Viewing+your+executable+capabilities) configured with a correct path for your Bamboo server as per [this document](https://confluence.atlassian.com/display/BAMBOO/Configuring+a+new+executable) and that you have the ANT capability configured for the agent that runs your plan?

If you still confront the same problem, please open a [support](https://support.atlassian.com) ticket and provide your [Bamboo server log file](https://confluence.atlassian.com/display/BAMBOO/Logging+in+Bamboo), plan key of the problematic plan, and screenshots of your Ant executable configuration and [ANT task](https://confluence.atlassian.com/display/BAMBOO/Ant) configuration pages. What is the problematic plan key?

Cheers,  
Armen

comments: author: Frederick Bass
body: I was using local agent to do this. Ant was configured properly. The workaround for me was to delete the build plan and create a new one. I don't see the exception anymore.