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

Ant problem using the Jazz Build Engine

 I recently decided to try out the RTC build engine so I created a simple hello world python script and a build.xml file to run it.

hello.py
print 'hello world'
	
	
	
build.xml
<project name="placeholder project" default="hello">
	<target name="hello">
		<exec executable="python" failonerror="true">
			<arg line="hello.py"/>
		</exec>
	</target>

	<target name="run">
		<antcall target="hello"/>
	</target>
</project>
	
	
	

This works well when running 'ant run' manually on the server that I want to execute the build on. But when I try to run it with the build engine I get this error.









2016-07-12 13:16:39 [Jazz build engine] 

2016-07-12 13:16:39 [Jazz build engine] Substituted the following build property variables:

2016-07-12 13:16:39 [Jazz build engine] team.scm.fetchDestination = ${build_dir}   -->   team.scm.fetchDestination = ${homedir}/hello

2016-07-12 13:16:39 [Jazz build engine] buildfile = ${build_dir}/Tools/builds/hello_world/build.xml   -->   buildfile = ${homedir}/hello/Tools/builds/hello_world/build.xml

2016-07-12 13:16:39 [Jazz build engine] build_dir = ${homedir}/hello   -->   build_dir = /home/builduser/workspace_tools-dev6-build01/hello

2016-07-12 13:16:39 [Jazz build engine] team.scm.fetchDestination = ${homedir}/hello   -->   team.scm.fetchDestination = /home/builduser/workspace_tools-dev6-build01/hello

2016-07-12 13:16:39 [Jazz build engine] buildfile = ${homedir}/hello/Tools/builds/hello_world/build.xml   -->   buildfile = /home/builduser/workspace_tools-dev6-build01/hello/Tools/builds/hello_world/build.xml

2016-07-12 13:16:39 [Jazz build engine] 

2016-07-12 13:16:39 [Jazz build engine] 

2016-07-12 13:16:39 [Jazz build engine] Substituted the following configuration element property variables:

2016-07-12 13:16:39 [Jazz build engine] com.ibm.team.build.ant : com.ibm.team.build.ant.buildFile = ${buildfile}   -->   com.ibm.team.build.ant.buildFile = /home/builduser/workspace_tools-dev6-build01/hello/Tools/builds/hello_world/build.xml

2016-07-12 13:16:39 [Jazz build engine] 

2016-07-12 13:16:39 [Jazz build engine] running on host: ***CENSORED***

2016-07-12 13:16:39 [Jazz build engine] Should build occur?

2016-07-12 13:16:39 [Jazz build engine] Yes: Always build a user initiated request.

2016-07-12 13:16:39 [Jazz build engine] Invoking pre-build participant "com.ibm.team.build.jazzscm"

2016-07-12 13:16:39 [Jazz build engine] Deleting fetch destination "/home/builduser/workspace_tools-dev6-build01/hello" before fetching ...

2016-07-12 13:16:39 [Jazz build engine] Fetching files to fetch destination "/home/builduser/workspace_tools-dev6-build01/hello" ...

2016-07-12 13:16:42 [Jazz build engine] Invoking build participant "com.ibm.team.build.ant"

Buildfile: /home/builduser/workspace_tools-dev6-build01/hello/Tools/builds/hello_world/build.xml


hello:


BUILD FAILED

java.lang.NoSuchMethodError: org/apache/tools/ant/launch/Locator.fromJarURI(Ljava/lang/String;)Ljava/lang/String;

at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:256)

at org.apache.tools.ant.helper.ProjectHelper2.parseUnknownElement(ProjectHelper2.java:131)

at org.apache.tools.ant.helper.ProjectHelper2.parseAntlibDescriptor(ProjectHelper2.java:111)

at org.apache.tools.ant.taskdefs.Antlib.createAntlib(Antlib.java:94)

at org.apache.tools.ant.taskdefs.Definer.loadAntlib(Definer.java:425)

at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:277)

at org.apache.tools.ant.ComponentHelper.checkNamespace(ComponentHelper.java:874)

at org.apache.tools.ant.ComponentHelper.getDefinition(ComponentHelper.java:307)

at org.apache.tools.ant.ComponentHelper.createComponent(ComponentHelper.java:284)

at org.apache.tools.ant.ComponentHelper.createComponent(ComponentHelper.java:263)

at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:430)

at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:164)

at org.apache.tools.ant.Task.perform(Task.java:347)

at org.apache.tools.ant.Target.execute(Target.java:435)

at org.apache.tools.ant.Target.performTasks(Target.java:456)

at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)

at org.apache.tools.ant.Project.executeTarget(Project.java:1376)

at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)

at org.apache.tools.ant.Project.executeTargets(Project.java:1260)

at org.apache.tools.ant.Main.runBuild(Main.java:853)

at org.apache.tools.ant.Main.startAnt(Main.java:235)

at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)

at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)


Total time: 0 seconds

Build failed. Exit value was 1.

I get the error "java.lang.NoSuchMethodError: org/apache/tools/ant/launch/Locator.fromJarURI(Ljava/lang/String;)Ljava/lang/String;".
When I google for it it seems that there is some problem with NetBeans and Java that usually causes this. But I'm not using NetBeans not Java (except for ant which I'm guessing is written in Java). Does anyone have any idea why this might happen?

Is the build using some other version of ant? If so, is it possible to change it to use the version that is on the server?
(I'm using CLM 6.0.1)

0 votes


Accepted answer

Permanent link
I don't have such problem with RTC 6.0.1 with the bundled ant 1.7.1. In fact, a user suggested that using a newer version of ant actually caused such problem.
https://forums.opensuse.org/showthread.php/459816-Problem-Java-ANT-NetBeans

There may be some problems with the ant library. To find out more, add "-v -d" to "Ant arguments" in the Ant tab of your build definition. You should see very detailed information in the build log.
Axel Ulmestig selected this answer as the correct answer

2 votes

Comments

 Hi


It turns out that the ant version in the build engine was off somehow.
I set the value under Ant -> 'Ant home' to point to the where ant was installed on
the server and it worked.

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
× 562
× 63
× 14

Question asked: Jul 12 '16, 9:46 a.m.

Question was seen: 3,336 times

Last updated: Jul 13 '16, 4:17 a.m.

Confirmation Cancel Confirm