ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Reilly" <peter.kitt.rei...@gmail.com>
Subject Re: How to get debug info on java task failure
Date Thu, 28 Sep 2006 17:17:13 GMT
"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
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message