Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Null Pointer Calling ANT StartBuildTask from Java Code

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

0 votes



One answer

Permanent link
This was posted in the announcements forum. Moving this to RTC forum.

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: May 04 '09, 6:06 a.m.

Question was seen: 5,007 times

Last updated: May 04 '09, 6:06 a.m.

Confirmation Cancel Confirm