ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <vinod.na...@iflexsolutions.com>
Subject RE: Error Handling
Date Thu, 20 May 2004 14:56:41 GMT
Hi All,

I am very naive to Ant technology.
I have this problem.

When I place ant 1.6.1 and weblogic.jar file of version 6.1 in the classpath I get this error.
What is this error due to?

JAVA_HOME:     /products/bea/610sp5/jdk131
WLS_HOME:      /products/bea/610sp5/wlserver6.1
ANT_HOME:     /products/bea/610sp5/wlserver6.1/lib/ant
TARGET_DIR:    /products/proj/app

Invalid implementation version between Ant core and Ant optional tasks.
 core    : 1.6.1
 optional: 6.1.2.0

Install failed

-----Original Message-----
From: Dale Anson [mailto:danson@germane-software.com]
Sent: Thursday, May 20, 2004 8:20 AM
To: Ant Users List
Subject: Re: Error Handling


An option would be to use the try/catch from Antelope, 
http://antelope.sourceforge.net. The syntax is slightly different from 
the ant-contrib try/catch, but it does provide a couple of things that 
the ant-contrib doesn't (at least not yet, it's been on my to-do list 
for the longest to get the two merged). Useful in your case is the 
ability to save the stack trace in a property so you can include it in 
your e-mail messages.

The docs for the Antelope version of try/catch are at:

http://antelope.tigris.org/nonav/docs/manual/bk03ch07.html

And the tasks themselves are at:

http://antelope.tigris.org/servlets/ProjectDocumentList

hth,

Dale


Thirumala.Thoka@fairchildsemi.com wrote:
> Hi Doug/All,
> 
> This helped me lot. I coded my job exactly similar way and is working 
> fine.
> 
> I have one more problem, i.e in my requirement I have to send an email 
> with the console log message to everyone saying that build is where 
> successful or failed. 
> 
> So as per the below email pls. map my targets as follows:
> 
> normalTarget    = build_dev
> failTarget            = sendFailEmail
> successTarget = sendSuccessEmail
> 
> In "build_dev" target I am generating log file and I am attaching that 
> file in the "send*Email" targets. So,if the build is success it is 
> attaching the full log file fine, but when build is failed it is able 
> attach the log file only with the content before it got failed, that means 
> it is not captuing [trycatch] block error message in the log file. How 
> could we solve this problem? My major requirement to send the mail is to 
> see the error message where does it failed/what is the problem.
> 
> Pls. advice if there is any better way to handle this problem... I would 
> appreciate your earliest response.
> 
> Regards,
> Thiru
> 
> 
> 
> 
> 
> "Daniels, Doug" <Doug.Daniels@gdc4s.com>
> 05/19/2004 10:01 AM
> 
>  
>         To:     Thirumala Thoka/Corporate/FSC@Fairchild, user@ant.apache.org
>         cc: 
>         Subject:        RE: Error Handling
> 
> 
> You can use the ant-contrib (http://ant-contrib.sourceforge.net/) <trycatch> task
(http://ant-contrib.sourceforge.net/tasks/trycatch.html), "Trytask is a wrapper that lets
you run a set of tasks and optionally 
> run a different set of tasks if the first set fails and yet another set 
> after the first one has finished."
> 
> For example:
> 
> <target name="taskFailCheck">
> <trycatch property="taskFailed" reference="errorRef">
>   <try>
>     <antcall target="normalTarget" />
>   </try>
> 
>   <catch>
>     <echo>Error caught: ${errorRef}</echo>
>   </catch>
> 
>   <finally>
>     <echo>Check if we failed and perform task otherwise perform other 
> task.</echo>
> 
>     <if> <isset property="taskFailed" /> <then>
>  
>        <antcall target="failTarget" />
> 
>     </then>
> 
> <!-- otherwise perform succesful task -->
>     <else>
> 
>        <antcall target="successTarget" />
> 
>     </else>
>     </if>
> 
>   </finally>
> </trycatch>
> </target>
> 
> You just replace the normalTarget, failTarget, and successTarget with your 
> targets, you could also just check the taskFailed property in the other 
> targets themselves, for example:
> 
> <target name="successTarget" unless="taskFailed">
> 
> or
> 
> <target name="failedTarget" if="taskFailed">
> 
> then you'd have a target setup like this to setup the order:
> 
> <target name="masterTarget" depends="taskFailCheck, successTarget, 
> failedTarget"/>
> 
> This task would run your trycatch then it would run either the 
> successTarget or the failedTarget depending on the success and failure of 
> the normalTarget target.
> 
> 
> To use ant-contrib tasks. First Download the ant-contrib tasks jar and 
> then at the top of your build file you must declare the ant-contrib tasks:
> <taskdef resource="net/sf/antcontrib/antcontrib.properties">
>   <classpath>
>     <pathelement location="/usr/share/java/lib/ant-contrib-0.3.jar"/>
>   </classpath>
> </taskdef>
> 
> 
> 
> -----Original Message-----
> From: Thirumala.Thoka@fairchildsemi.com
> [mailto:Thirumala.Thoka@fairchildsemi.com]
> Sent: Monday, May 17, 2004 4:58 PM
> To: dev@ant.apache.org
> Subject: Error Handling
> 
> 
> Hi All,
> 
> How do we capture the error on ANT target, if it does success do one thing 
> 
> otherwise do other thing. So, basically how do we code this requirement.
> 
> I did little bit of try with "failureonerror", "haltonerror" attributes 
> but it's not accepting those attributes at all.
> I would appreciate your ealiest response. Pls. do ask me if you need more 
> details about the question.
> 
> Regards,
> Thiru
> 
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message