ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Devienne" <ddevie...@gmail.com>
Subject Re: Java error in heretofore stable, working task
Date Thu, 23 Aug 2007 15:30:28 GMT
On 8/23/07, cknell@onebox.com <cknell@onebox.com> wrote:
> Pertinent facts:
> Ant - version 1.7.0
> JDK - version 1.5.0.06
>
> I have a task that has been performing as expected for about five months. Today, with
no change in the version of Ant, the build.xml file, the JDK, the stylesheet, or the XSLT
processor, this error occurred for the first time (and appears on all subsequent attempts
to run the task):
>
> BUILD FAILED
> build.xml:82: java.lang.reflect.InvocationTargetException
>
> The task beginning on line 82 is:
>
> <xslt style="${env.REPORTS_HOME}/Errors/PackedField/xslt/stage-1.xslt" in="${xml.dir}/${DSTAMP}.c.xml"
out="${xml.dir}/${DSTAMP}.d.xml" processor="trax">
>   <param name="position-codes" expression="${env.REPORTS_HOME}/hiring-report/xml/position-translation.xml"
/>
> </xslt>

You'll pick up Saxon only if it's first in the classpath. It's very
likely your classpath has changed, despite you're saying that nothing
changed.

> When I run the transformation from the command line, the output document is produced
with no complaint.
>
> My command line invocation is:
>
> java net.sf.saxon.Transform  -o ./xml/20070823.d.xml ./xml/20070823.c.xml ./xslt/stage-1.xslt
position-codes=H:/reports-FY07/hiring-report/xml/position-translation.xml
>
> I tried replacing the <xslt> task with a <java> task to see if the problem
was related to the code behind the <xslt> task, but so far I haven't been able to get
the java task to execute.
>
> Java task:
>
> <java classname="net.sf.saxon.Transform" fork="true">
>   <arg value="o ./xml/20070823.d.xml" />
>   <arg value="./xml/20070823.c.xml" />
>   <arg value="./xslt/stage-1.xslt" />
>   <arg value="position-codes=H:/reports-FY07/hiring-report/xml/position-translation.xml"
/>
> </java>

Here you also don't specify a classpath, so you rely on an externally
defined CLASSPATH env var...

Your <java> invocation is wrong. value is for a single arg, and "o
file" is not a single arg.
<arg value="-o"/> <arg file="..."/> is the correct way, or <arg
line="-o file"/>, but using <arg file> lets Ant do the right things
with file names.

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


Mime
View raw message