ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 4065] - Regexp mapper and classpath
Date Tue, 13 Nov 2001 16:09:21 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4065>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4065

Regexp mapper and classpath





------- Additional Comments From bodewig@apache.org  2001-11-13 08:09 -------
OK, let's start with the documentation bug - it is documented in my copy, but I'm
not 100% sure that the paragraph

The classpath can be specified via a nested <classpath>, as well - that is,
a path-like structure.
has always been there - I've changed the file to add a heading and make it more
visible now.
No, a nested <classpath> element will do exactly the same as your classpathref
attribute.

Let me rephrase what I've written in the style case for regexp - it is not about
conflicting libraries or so:

org.apache.tools.ant.util.regexp.JakartaRegexpRegexp is part of optional.jar.
optional.jar is in ANT_HOME/lib and thus will be put into CLASSPATH, which means
it can be found by the system classloader - the parent of all classloaders.

You give an additional classpath that contains the jakarta-regexp library and
maybe even set the system property to tell Ant you want to use jakarta-regexp.

Ant tries to load org.apache.tools.ant.util.regexp.JakartaRegexpRegexp via a new
classloader that contains the CLASSPATH you've specified.  Being a good
classloader, Ant's classloader does like Sun asks it to do and consults the
system classloader first.  Great, the class can be found and loaded via the
system classloader.  Now, this class needs additional classes from the JAR you've
supplied - it tries to load them, but as it has been loaded via the system
classloader, it doesn't know about your JAR and fails to find the classes.

This is where my proposed solution kicks in, remove the class from optional.jar.
If the class cannot be found via the system classloader, you can specify the
additional library as well.

I hope this is at least a little clearer.

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


Mime
View raw message