ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran" <stev...@iseran.com>
Subject Re: Exception reading component ... ???
Date Sun, 16 Jun 2002 22:06:32 GMT

should all work. You using java1.4 by any chance?

----- Original Message -----
From: "Elizabeth Barham" <soggytrousers@yahoo.com>
To: <ant-user@jakarta.apache.org>
Sent: Sunday, June 16, 2002 12:34
Subject: Exception reading component ... ???


> Hi,
>
> I am new to ant. I am trying to run a java application that is housed
> in a jar file in a local directory, ${lib}.
>
>     <java
>   classname="org.txt2xml.cli.Batch"
>   classpathref="txt2xml.cp">
>       <arg file="${listing.dsc}" />
>       <arg file="${listing.txt}" />
>     </java>
>
> txt2xml.cp:
>
>   <path id="txt2xml.cp">
>     <pathelement location="${lib}/txt2xml.jar"/>
>     <pathelement location="${lib}/jdom.jar"/>
>     <pathelement location="${lib}/commons-collections.jar"/>
>     <pathelement location="${lib}/commons-logging.jar"/>
>     <pathelement location="${lib}/junit.jar"/>
>     <pathelement location="${lib}/scope-bin.jar"/>
>     <pathelement location="${lib}/xml-apis.jar"/>
>     <pathelement location="${lib}/xercesImpl.jar"/>
>    </path>
>
> I have unset my CLASSPATH. The error that occurs is:
>
>   java.lang.NoClassDefFoundError: org/xml/sax/Parser
>
> Which is defined in xml-apis.jar:
>
>   559  02-06-02 10:49   org/xml/sax/Parser.class
>
> Prior to this error, though, there is mention in the "-debug" output
> of:
>
>   Finding class org.xml.sax.Parser
>   Exception reading component  ${lib}/xml-apis.jar
>
> In my normal, day-to-day CLASSPATH, I have many .jar files that
> implement the same classes. To the best of my knowledge, this is
> perfectly acceptable as the JVM just uses the first one it finds and
> ignores the rest. Apparently, though, this causes problems with ant as
> I believe that xml-apis.jar is trying to define classes that have
> already been defined in another previously loaded .jar file.
>
> Is there a simple work-around or am I not doing something right?
>
> Thank you, Elizabeth
>
> --
> To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
>
>


--
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