From users-return-6475-apmail-continuum-users-archive=continuum.apache.org@continuum.apache.org Wed May 14 08:07:40 2008 Return-Path: Delivered-To: apmail-continuum-users-archive@www.apache.org Received: (qmail 43855 invoked from network); 14 May 2008 08:07:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 May 2008 08:07:39 -0000 Received: (qmail 98496 invoked by uid 500); 14 May 2008 08:07:39 -0000 Delivered-To: apmail-continuum-users-archive@continuum.apache.org Received: (qmail 98470 invoked by uid 500); 14 May 2008 08:07:39 -0000 Mailing-List: contact users-help@continuum.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@continuum.apache.org Delivered-To: mailing list users@continuum.apache.org Received: (qmail 98448 invoked by uid 99); 14 May 2008 08:07:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 May 2008 01:07:39 -0700 X-ASF-Spam-Status: No, hits=-1.0 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [15.192.0.45] (HELO g5t0008.atlanta.hp.com) (15.192.0.45) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 May 2008 08:06:51 +0000 Received: from G1W0400.americas.hpqcorp.net (g1w0400.americas.hpqcorp.net [16.236.31.10]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by g5t0008.atlanta.hp.com (Postfix) with ESMTP id 41BD424680 for ; Wed, 14 May 2008 08:07:00 +0000 (UTC) Received: from G3W0628.americas.hpqcorp.net (16.233.58.53) by G1W0400.americas.hpqcorp.net (16.236.31.10) with Microsoft SMTP Server (TLS) id 8.1.263.0; Wed, 14 May 2008 08:05:56 +0000 Received: from G3W1113.americas.hpqcorp.net ([16.232.82.1]) by G3W0628.americas.hpqcorp.net ([16.233.58.53]) with mapi; Wed, 14 May 2008 08:05:56 +0000 From: "Och, Andrew Daniel (TSG-GDCC-SH)" To: "users@continuum.apache.org" Date: Wed, 14 May 2008 08:05:54 +0000 Subject: RE: Triggering a build via xmlrpc and getting the result for that build Thread-Topic: Triggering a build via xmlrpc and getting the result for that build Thread-Index: Aci04PBZq/Rx/BkSTU2vsEAGBDqrfAAAonoAAAFYe4AAALwssAArMPhw Message-ID: <0A50C3A4CC15A3448AB46C39B461BDA82A69F50474@G3W1113.americas.hpqcorp.net> References: <0A50C3A4CC15A3448AB46C39B461BDA82A69F4FC60@G3W1113.americas.hpqcorp.net> <345B49632E927F4E9C258E0685DA919C0370848E@ELSOXFEXCP11VA.science.regn.net> <0A50C3A4CC15A3448AB46C39B461BDA82A69F4FCDA@G3W1113.americas.hpqcorp.net> <345B49632E927F4E9C258E0685DA919C0370852E@ELSOXFEXCP11VA.science.regn.net> In-Reply-To: <345B49632E927F4E9C258E0685DA919C0370852E@ELSOXFEXCP11VA.science.regn.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Dear Jon Yes that works, putting in a Thread.sleep(...) i.e. client.buildProject(projectSummaryID, buildDefinition.getId()); Thread.sleep(...); BuildResult buildResult =3D client.getLatestBuildResult(projectSummaryID); Its not a very robust solution but I guess its good enough for me :-) Once again thanks for the help. Best regards Andrew Och -----Original Message----- From: SlinnHawkins, Jon (ELS-CAM) [mailto:J.SlinnHawkins@elsevier.com] Sent: Tuesday, May 13, 2008 8:06 PM To: users@continuum.apache.org Subject: RE: Triggering a build via xmlrpc and getting the result for that = build The problem is that when you issue the buildProject() cmd Continuum has to = interpret it and then trigger a build. At the point where buildProject ret= urns there may not (or may) be a buildId. Once the build has triggered the buildId will be created and associated wit= h the project. Wait a couple of seconds for the build to start then issue the getLatestBui= ldResult cmd. -----Original Message----- From: Och, Andrew Daniel (TSG-GDCC-SH) [mailto:andrew.och@hp.com] Sent: 13 May 2008 12:20 To: users@continuum.apache.org Subject: RE: Triggering a build via xmlrpc and getting the result for that = build Dear Jon Thanks for the help and suggestion. Unfortunately getting the getLatestBuildResult(projectSummaryID) doesn't re= ally work as can be seen by the code snippet and the resulting error (only = when I start with an empty build history): client.buildProject(projectSummaryID, buildDefinition.getId()); BuildResult= buildResult =3D client.getLatestBuildResult(projectSummaryID); [INFO][2008-05-13 19:02:05][com.chn.hp.test.client.ContClient]- BUILD Proje= ct ID: 2 buildDefId: 18 org.apache.xmlrpc.XmlRpcException: Failed to invoke method getLatestBuildRe= sult in class org.apache.maven.continuum.xmlrpc.server.ContinuumServiceImpl: null at org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStream Transport.java:184) at org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamT ransport.java:145) at org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTrans port.java:94) at org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHtt pTransport.java:39) at org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.j ava:53) at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:166) at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:136) at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:125) at org.apache.xmlrpc.client.util.ClientFactory$1.invoke(ClientFactory.java: 104) at $Proxy0.getLatestBuildResult(Unknown Source) at org.apache.maven.continuum.xmlrpc.client.ContinuumXmlRpcClient.getLatest BuildResult(ContinuumXmlRpcClient.java:333) at com.chn.hp.test.client.ContClient.(ContClient.java:150) at com.chn.hp.test.client.ContClient.main(ContClient.java:171) If there are builds in the history, getting the latest build actually retri= eves the previous build result! I believe that this is because buildProject() puts the build into a queue. When my next line of code execu= tes retrieving the latest build result (the one I just triggered has not ha= d time to be created). Hence I am trying to link the specific buildProject(...) trigger to a speci= fic BuildResult. ie something like below would be nice: int buildID =3D client.buildProject(projectSummaryID, buildDefinitionID); B= uildResult buildResult =3D client.getBuildResult(projectSummaryID, buildID); BUT the xmlrpc api does not offer the above, or does it, or does it offer a= different way? Best regards Andrew Och -----Original Message----- From: SlinnHawkins, Jon (ELS-CAM) [mailto:J.SlinnHawkins@elsevier.com] Sent: Tuesday, May 13, 2008 6:26 PM To: users@continuum.apache.org Subject: RE: Triggering a build via xmlrpc and getting the result for that = build Hi Andrew, Use client.getLatestBuildResult(projectSummaryId); http://continuum.apache.org/ref/latest/apidocs/org/apache/maven/continuu m/xmlrpc/client/ContinuumXmlRpcClient.html Cheers Jon -----Original Message----- From: Och, Andrew Daniel (TSG-GDCC-SH) [mailto:andrew.och@hp.com] Sent: 13 May 2008 11:06 To: users@continuum.apache.org Subject: Triggering a build via xmlrpc and getting the result for that buil= d I would like to trigger a build via xmlrpc and get the result for that buil= d. I use the buildProject(...) method to start a forced build. However how do = I get the associated buildID from this trigger? Without a buildId I can not= get a BuildResult for the build I triggered. client.buildProject(projectSummaryID, buildDefinitionID); BuildResult build= Result =3D client.getBuildResult(projectSummaryID, buildID); Am I being stupid? Have I missed something? Best Regards Andrew Och This email is from Elsevier Limited, a company registered in England and Wa= les with company number 1982084, whose registered office is The Boulevard, = Langford Lane, Kidlington, Oxford, OX5 1GB, United Kingdom.