ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ckn...@onebox.com
Subject re :How to get debug info on java task failure]
Date Thu, 28 Sep 2006 18:13:07 GMT
I found a typo was causing my error.  Thanks.
-- 
Charles Knell
cknell@onebox.com - email



-----Original Message-----
From:     cknell@onebox.com
Sent:     Thu, 28 Sep 2006 13:31:16 -0400
To:       user@ant.apache.org
Subject:  RE: Re: How to get debug info on java task failure

The %ERRORLEVEL% value is 0, so I'm really no closer to understanding why the execution of
the class works at the command line and fails in Ant.

Is there a way to get more information from Ant?
-- 
Charles Knell
cknell@onebox.com - email



-----Original Message-----
From:     Peter Reilly <peter.kitt.reilly@gmail.com>
Sent:     Thu, 28 Sep 2006 18:17:13 +0100
To:       "Ant Users List" <user@ant.apache.org>
Subject:  Re: How to get debug info on java task failure

"Java returned: 1" means that the java program called System.exit(1) to
finish its execution. This return code is not shown when you
call from the command line, it is placed in the env variable %ERRORLEVEL% on
dos,
so after calling the java program call
echo %ERRORLEVEL%

Peter

On 9/28/06, cknell@onebox.com <cknell@onebox.com> wrote:
>
> I am executing a single <java> task. I have the failonerror attribute set
> to "true". It fails, but I don't have any information to work with. This is
> the target.
>
> <target name="fetch-sql-string">
>   <java classname="com.surreylane.oracle.SQLQueryText"
>            outputproperty="sql.string"
>            failonerror="true" fork="true">
>     <classpath>
>       <pathelement location="./XMLfromSPOOL/mars.jar" />
>       <pathelement location="c:/oracle/ora90JavaXDK/lib/xsu12.jar" />
>       <pathelement location="c:/oracle/ora90JavaXDK/lib/xmlparserv2.jar"
> />
>     </classpath>
>     <arg value="QueryFileName=queries.xml" />
>     <arg value="QueryName=hiring-report" />
>   </java>
>   <echo>SQL string is ${sql.string}</echo>
> </target>
>
> The output I get is: "BUILD FAILED H:\dev\java\buildj.xml:46: Java
> returned: 1"
>
> When I execute what I believe to be the identical class from the command
> line, I have no problem. Here is the command line, reformatted for clarity:
>
> java -cp mars.jar;C:\oracle\ora90JavaXDK\lib\xsu12.jar;
> c:\oracle\ora90JavaXDK\lib\xmlparserv2.jar
> com.surreylane.oracle.SQLQueryText QueryFileName=../queries.xml
> QueryName=hiring-report
>
> How can I get more information from Ant on exactly what's gone wrong?
>
> Thanks.
> --
> Charles Knell
> cknell@onebox.com - email
>
> ---------------------------------------------------------------------
> 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




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


Mime
View raw message