It's all about the answers!

Ask a question

Unable to use StartBuildActivityTask

p m n (271913) | asked Jul 04 '14, 5:39 a.m.
edited Jul 13 '14, 8:44 a.m. by Jennifer Cianchetta-Riordan (2512)
Environment: RHEL 32-bit. Build toolkit for RTC 4.0.5.

I'm unable to get the following script to work:

<?xml version="1.0" encoding="UTF-8"?>
<!-- buildstep.xml -->
<project name="buildStep" default="report_task" basedir=".">

    <taskdef name="startBuildActivity"
               classname="" />
    <target name="report_task" description="Report task status to JBE" >
        <startBuildActivity label="testlabel"
            autoComplete="true" />




14: pmn@rhel-pc /tmp > ant -f /tmp/buildstep.xml -lib /usr/opt/jazz/buildsystem/buildtoolkit
Buildfile: /tmp/buildstep.xml
/tmp/buildstep.xml:5: taskdef class cannot be found
Total time: 0 seconds
15: pmn@rhel-pc /tmp >

This doesn't work even when I include BuildToolkitTaskDefs.xml into buildstep.xml.

<import file="/usr/opt/jazz/buildsystem/buildtoolkit/BuildToolkitTaskDefs.xml" />

Contents of the build toolkit folder:

15: pmn@rhel-pc /tmp > ls -l /usr/opt/jazz/buildsystem/buildtoolkit/*.jar | wc -l
16: pmn@rhel-pc /tmp >

17: pmn@rhel-pc /tmp > ls -l /usr/opt/jazz/buildsystem/buildtoolkit/*
-rw-r--r-- 1 haddm ccusers  33879 Oct 26  2013 /usr/opt/jazz/buildsystem/buildtoolkit/
-rw-r--r-- 1 haddm ccusers  15034 Oct 26  2013 /usr/opt/jazz/buildsystem/buildtoolkit/
-rw-r--r-- 1 haddm ccusers 127159 Oct 26  2013 /usr/opt/jazz/buildsystem/buildtoolkit/
-rw-r--r-- 1 haddm ccusers  58848 Oct 26  2013 /usr/opt/jazz/buildsystem/buildtoolkit/
-rw-r--r-- 1 haddm ccusers  26532 Oct 26  2013 /usr/opt/jazz/buildsystem/buildtoolkit/
-rw-r--r-- 1 haddm ccusers 714943 Oct 26  2013 /usr/opt/jazz/buildsystem/buildtoolkit/
-rw-r--r-- 1 haddm ccusers  98519 Oct 26  2013 /usr/opt/jazz/buildsystem/buildtoolkit/
-rw-r--r-- 1 haddm ccusers  42498 Oct 26  2013 /usr/opt/jazz/buildsystem/buildtoolkit/
-rw-r--r-- 1 haddm ccusers 286508 Oct 26  2013 /usr/opt/jazz/buildsystem/buildtoolkit/
18: pmn@rhel-pc /tmp >

What am I missing here? 


p m n commented Jul 04 '14, 5:47 a.m. | edited Jul 04 '14, 5:50 a.m.

NOTE: Please ignore the 

<="" i=""> in the above file. They are not part of the actual file. 

2 answers

permanent link
Ralph Schoon (60.7k33643) | answered Jul 04 '14, 7:42 a.m.
This error usually comes up if you forget to include the BuildToolkitTaskDefs.xml. There is a description how to do that in

Please check that you have actually followed these steps. You clami you did, however, the error indicates otherwise.

It says:

To use these Ant tasks in your scripts, from installdir/buildsystem/buildtoolkit/BuildToolkitTaskDefs.xml, where installdir is the location where you installed the Ant build toolkit, copy the various taskdef entries in the BuildToolkitTaskDefs.xml file to your project's Ant script. You can also use your Ant script to import the taskdef file.

Note: If you use command line builds that need to call out to the Ant toolkit, add the location of the buildtoolkit directory to the Ant library path when invoking Ant. Typically, you perform this task by invoking Ant with the -lib argument. For example: ant -f build.xml -lib installdir/buildsystem/buildtoolkit .
Note: For information about automating the builds of applications using the Rational® Application Developer for WebSphere® Software build utility (the build utility), see Automate the builds of applications.

permanent link
p m n (271913) | answered Jul 09 '14, 4:30 a.m.
[The file has the import BuildToolkitTaskDefs.xml line and the necessary jars.]

The error was due to a very old Ant installation. 

The current verison of Ant (apache-ant-1.9.4-bin.tar.gz) was installed, the ANT_HOME environment variable was set to the Ant install dir, and its 'bin' folder was added to the PATH variable. This fixed the 'taskdef class not found' issue. 

22: pmn@rhel-pc ~ > ant -f /tmp/buildstep.xml -lib /usr/opt/jazz/buildsystem/buildtoolkit
Buildfile: /tmp/buildstep.xml
/tmp/buildstep.xml:14: Missing required attribute "repositoryAddress".
Total time: 5 seconds
23: pmn@rhel-pc ~ > 
23: pmn@rhel-pc ~ > ant -version
Apache Ant(TM) version 1.9.4 compiled on April 29 2014
24: pmn@rhel-pc ~ >

Ralph Schoon commented Jul 09 '14, 8:16 a.m.

The call complains about a missing parameter. I don't think that has anything to do with the ANT version.

p m n commented Jul 09 '14, 9:16 p.m. | edited Jul 09 '14, 9:19 p.m.

The first error ("

taskdef class cannot be found"
) was what I was trying to get past. That was due to an ancient Ant installation on my Linux box.

The current error just says that I'm missing the required parameters to the
 task. This IMHO is OK, because now I have got to the point where the task is being recognized. I can now work on providing the right parameters to this task. In other words, my issue has been resolved.

Your answer

Register or to post your answer.