[Solved] waitForTeamBuild fails with ClassCastException.
I'm having issues running waitForTeamBuild from my ant build script as it fails with a ClassCastException.
I'm running the following (had to strip the angle brackets from around waitForTeamBuild to get it to display in the forum)
-------
-------
and I get
---------
repositoryAddress=https://jazz1.hal.com:9443/jazz/
userId=builduser@hal.com
passwordFile=../../contbld.pass
buildResultUUID=_PvTr4FJSEeGraYolFu-tzQ
Not using a proxy to reach https://jazz1.hal.com:9443/jazz/
java.lang.ClassCastException: $Proxy18 incompatible with com.ibm.team.build.common.model.IBuildResult
at com.ibm.team.build.ant.task.WaitForTeamBuildTask.getBuildResult(WaitForTeamBuildTask.java:334)
/test/jazz_build/jbe_charles/jazz/buildsystem/buildengine/eclipse/personal_build/ant_build/build-it.xml:184: java.lang.ClassCastException: $Proxy18 incompatible with com.ibm.team.build.common.model.IBuildResult
at com.ibm.team.build.ant.task.AbstractTeamBuildTask.execute(AbstractTeamBuildTask.java:666)
at com.ibm.team.build.ant.task.WaitForTeamBuildTask.doExecute(WaitForTeamBuildTask.java:241)
at com.ibm.team.build.ant.task.AbstractTeamBuildTask.execute(AbstractTeamBuildTask.java:653)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
--------
has anyone any suggestions what I'm doing wrong or how I debug this?
------
I found the answer myself but can't accept my own answers to close the question.
I'm running the following (had to strip the angle brackets from around waitForTeamBuild to get it to display in the forum)
-------
<echo>repositoryAddress=${repositoryAddress}</echo>
<echo>userId=${userId}</echo>
<echo>passwordFile=${passwordFile}</echo>
<echo>buildResultUUID=${async.test.build.uuid}</echo>
waitForTeamBuild repositoryAddress="${repositoryAddress}"
userId="${userId}"
passwordFile="${passwordFile}"
buildResultUUID="${async.test.build.uuid}"
buildStateProperty="fatbuildState"
verbose="true"
interval="10"
timeout="10800"
-------
and I get
---------
repositoryAddress=https://jazz1.hal.com:9443/jazz/
userId=builduser@hal.com
passwordFile=../../contbld.pass
buildResultUUID=_PvTr4FJSEeGraYolFu-tzQ
Not using a proxy to reach https://jazz1.hal.com:9443/jazz/
java.lang.ClassCastException: $Proxy18 incompatible with com.ibm.team.build.common.model.IBuildResult
at com.ibm.team.build.ant.task.WaitForTeamBuildTask.getBuildResult(WaitForTeamBuildTask.java:334)
/test/jazz_build/jbe_charles/jazz/buildsystem/buildengine/eclipse/personal_build/ant_build/build-it.xml:184: java.lang.ClassCastException: $Proxy18 incompatible with com.ibm.team.build.common.model.IBuildResult
at com.ibm.team.build.ant.task.AbstractTeamBuildTask.execute(AbstractTeamBuildTask.java:666)
at com.ibm.team.build.ant.task.WaitForTeamBuildTask.doExecute(WaitForTeamBuildTask.java:241)
at com.ibm.team.build.ant.task.AbstractTeamBuildTask.execute(AbstractTeamBuildTask.java:653)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
--------
has anyone any suggestions what I'm doing wrong or how I debug this?
------
I found the answer myself but can't accept my own answers to close the question.
2 answers
I have not seen this, however, are you sure you have matching versions of JBE and RTC installed?
After further inveastigation it seems there are multiple UUIDs for each build. There is the requestUUID and the buildResultUUID. I was passing the requestUUID to waitForTeamBuild and I was labelling it the buildResultUUID. Once I changed my code to read
passwordFile="${passwordFile}"
requestUUID="${async.test.build.uuid}"
buildStateProperty="fatbuildState"
then it works.
I'm not entirely sure why we need multiple UUIDs and the error message could have been a little clearer but it was user error. Thanks for looking at this.