It's all about the answers!

Ask a question

Null Pointer Calling ANT StartBuildTask from Java Code


Andrew Harmel-Law (14612218) | asked May 04 '09, 6:06 a.m.
I am trying to write a Hudson plugin for Jazz SCM. I have followed the basic ANT build tutorials on the Jazz website but need to call the current ANT API from Java if I am to be able to write a usable plugin. I have managed to get the basic plugin skeleton code written for but when I request a build I get the following error:


started

FATAL: java.lang.NullPointerException

java.lang.NullPointerException

at com.ibm.team.build.ant.task.AbstractTeamBuildTask.execute(AbstractTeamBuildTask.java:432)

at org.jvnet.hudson.tools.JazzSCM.checkout(JazzSCM.java:130)

at hudson.model.AbstractProject.checkout(AbstractProject.java:529)

at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:223)

at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:189)

at hudson.model.Run.run(Run.java:646)

at hudson.model.Build.run(Build.java:102)

at hudson.model.ResourceController.execute(ResourceController.java:70)

at hudson.model.Executor.run(Executor.java:62)

Caused by: java.lang.NullPointerException

at com.ibm.team.build.ant.task.StartBuildTask.verifyTeamBuildListenerIsActive(StartBuildTask.java:197)

at com.ibm.team.build.ant.task.StartBuildTask.doExecute(StartBuildTask.java:178)

at com.ibm.team.build.ant.task.AbstractTeamBuildTask.execute(AbstractTeamBuildTask.java:419)

... 8 more

--- Nested Exception ---

java.lang.NullPointerException

at com.ibm.team.build.ant.task.StartBuildTask.verifyTeamBuildListenerIsActive(StartBuildTask.java:197)

at com.ibm.team.build.ant.task.StartBuildTask.doExecute(StartBuildTask.java:178)

at com.ibm.team.build.ant.task.AbstractTeamBuildTask.execute(AbstractTeamBuildTask.java:419)

at org.jvnet.hudson.tools.JazzSCM.checkout(JazzSCM.java:130)

at hudson.model.AbstractProject.checkout(AbstractProject.java:529)

at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:223)

at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:189)

at hudson.model.Run.run(Run.java:646)

at hudson.model.Build.run(Build.java:102)

at hudson.model.ResourceController.execute(ResourceController.java:70)

at hudson.model.Executor.run(Executor.java:62)


The code I have which gives this is as follows:

StartBuildTask myStartBuildTask = new StartBuildTask();
String label = (new Date().toString());
myStartBuildTask.setAutoComplete(false);
myStartBuildTask.setBuildDefinitionId(getBuildDefinitionId()); // Prelude Team build 2
myStartBuildTask.setLabel("Build-" + label);
myStartBuildTask.setResultUUIDProperty("buildResultUUID");
myStartBuildTask.setEngineId(getBuildEngineId()); // standalone
myStartBuildTask.setPassword(getPassword()); // build
myStartBuildTask.setRepositoryAddress(getRepositoryLocation()); // https://localhost:9443/jazz
myStartBuildTask.setUserId(getUsername()); // build

myStartBuildTask.execute();


My Jazz Server is running and I have my build set up in Jazz as follows:

ID: Prelude Team build 2
Team Area: Prelude Team
Supporting Build Engine: standalone (which is Active (idle), in the Prelude Team Area)


I have tried downloading the source code from Jazz.net, but I cannot find the code for
com.ibm.team.build.ant.task.StartBuildTask.verifyTeamBuildListenerIsActive



I've tried debugging too and looking at the documented API but there seems like there is nothing else I need to provide.

Can anyone point me in the direction of a solution for this problem?

TIA

Cheers, Andrew

One answer



permanent link
Seth Packham (1.4k42213) | answered May 14 '09, 11:55 p.m.
FORUM ADMINISTRATOR / JAZZ DEVELOPER
This was posted in the announcements forum. Moving this to RTC forum.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.