Thanks to you and to Ruel.

Mea culpa, but I don't understand why some classes tacked on to the end of the 
CLASSPATH would override the Saxon which is at the beginning, but they did.

I was trying out DITA (OASIS Darwin Information Typing Architecture) and I 
tacked some classes for it onto the end of the classpath and entirely forgot!

Nonetheless, I now have the answer and I've rolled the CLASSPATH back to the 
previous version. Things work as they did before. I'll now work out how to add 
it back without breaking anything else.

P.S.

Thanks for pointing out my mistake with the <java> arguments. I don't use that 
element often, and the rules slipped my mind.
-- 
Charles Knell
[EMAIL PROTECTED] - email



-----Original Message-----
From:     Dominique Devienne <[EMAIL PROTECTED]>
Sent:     Thu, 23 Aug 2007 10:30:28 -0500
To:       "Ant Users List" <[email protected]>
Subject:  Re: Java error in heretofore stable, working task

On 8/23/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to