ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Stirling" <scottstirl...@rcn.com>
Subject RE: Problems with <arg line="..."/>
Date Sat, 08 Dec 2001 02:03:54 GMT
The problem you're showing (LinkageError) is most likely due to one classloader attempting
to load a class that its parent
classloader already loaded.  It's a failure on the custom loader's part to delegate to its
parent properly.  In this case, the Xalan
class and Ant itself both tried to load the commonly used org.xml.sax.InputSource class (Ant
loaded it first, in order to process
the build.xml).

The solution I would recommend is to use fork="true" in your java task.

Scott Stirling
Framingham, MA

> -----Original Message-----
> From: Christopher R. Gardner [mailto:crgardner@charter.net]
>
> I'm trying to use Ant 1.4.1 (in Cygwin on a Windows 98) to execute Xalan.
> Specifically, I want to convert an xml file to an html file.  When I run this
> command on the command line, everything works as expected (no errors; the file
> is translated):
>
> ****************
> $ java org.apache.xalan.xslt.Process -in greeting.xml -xsl
> greeting_html.xsl -out greeting.html
> ****************
>
> However, when I try to run this build.xml file (which resides in the same
> directory as the xml, xsl, and html files):
>
> ****************
> <project name="Hello, World!" default="build" basedir=".">
>     <property environment="env"/>
>
>     <target name="build">
>         <java classname="org.apache.xalan.xslt.Process">
>             <arg line="-in greeting.xml -xsl greeting_html.xsl -out
> greeting.html"/>
>             <classpath>
>                 <pathelement location="${env.XALAN_BIN}/xerces.jar"/>
>                 <pathelement location="${env.XALAN_BIN}/xalan.jar"/>
>                 <pathelement location="${env.XALAN_BIN}/bsf.jar"/>
>             </classpath>
>         </java>
>     </target>
> </project>
>
> ****************
>
> I have the following error:
>
> ****************
> build:
>      [java]
>      [java] (Location of error unknown)XSLT Error (java.lang.LinkageError):
> loader constraints violated when linking org/xml/sax/InputSource class
> Signal 127
>
> ****************
>
> I know Ant is sending some semblance of the arguments because when I make this
> change to the build.xml:
>
> ****************
> <arg value="-in"/>
> ****************
>
> because I get this error:
>
> ****************
> build:
>      [java] Missing argument for option: -IN
>      [java]
>      [java] (Location of error unknown)XSLT Error (java.lang.LinkageError): load
> er constraints violated when linking org/xml/sax/InputSource class
> Signal 127
> ****************
> Xalan needs a set of arguments and a values (e.g., -in greeting.xml -xsl
> greeting_html.xsl -out greeting.html)
>
> It seems I can't make Ant understand this.  What am I doing wrong?  I've even
> tried using an <arg value="..."/> for each argument and file name (e.g., <arg
> value="-in greeting.xml"/>, but I believe the documentation says you can have
> only one instance of an arg.
>
> Thanks.
>
> Chris Gardner


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


Mime
View raw message