ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kerry, Richard" <>
Subject RE: Use of XML Catalog with Ant (xslt task) - request for example
Date Fri, 13 Sep 2013 16:08:08 GMT

Ok, right, good, back on this again for a while after a break .....

My preference is to do the job entirely within the Ant file, so using <classpath> or

I won't use -cp, as advised here.

I don't want to have to do any special copying after unpacking so I'd rather not copy jars
into $ANT_HOME/lib if I don't need to.

"ant-resolver.jar and xml-resolver.jar "

hang on a moment .............  what are these ?

I thought I just needed resolver.jar from xml-commons-resolver-1.2 (assuming that's the latest),
so what are these two ?

And (previous response) I don't touch ant-apache-resolver.jar, which is already under ant/lib,
as it's an internal library

Now, back to catalog-specific issues.

There are three components to resolving urls using a catalog that I haven't seen explained
clearly yet for Ant.

1.  The resolver.  The discussion above is about this.  I hope I'm getting closer to getting
this working, though I can't see it yet.

2.  The catalog file itself.  I have this already as I've been using it from Saxon

3.  The Catalog manager properties file.  Again I've been using one of these from Saxon.

What is not clear to me is which one of these files needs to be specified in the <xmlcatalog>
element.  Given that the properties file specifies the (relative) location of the catalog
file itself I assume that's the one I need to specify.   Can someone please confirm this,
or explain otherwise ?

The thing that's worrying me is that unless all these aspects are sorted then the system won't
work.  And that I can't tell which one is wrong.

I am seeing the following messages :

"Apache resolver library not found, internal resolver will be used
Failed to load Apache resolver: java.lang.NoClassDefFoundError: org/apache/xml/resolver/tools/CatalogResolver"

Which looks like it's saying I haven't got the resolver loaded.

I hope someone can help.




Richard Kerry
BNCS Engineer, SI SOL Telco & Media Vertical Practice
T: +44 (0)20 82259063[X]<thismessage:/Body.htm#>
M: +44 (0)7812 325518[X]<thismessage:/Body.htm#>
G300, Stadium House, Wood Lane, London, W12 7TA<>

This e-mail and the documents attached are confidential and intended solely for the addressee;
it may also be privileged. If you receive this e-mail in error, please notify the sender immediately
and destroy it. As its integrity cannot be secured on the Internet, the Atos group liability
cannot be triggered for the message content. Although the sender endeavours to maintain a
computer virus-free network, the sender does not warrant that this transmission is virus-free
and will not be liable for any damages resulting from any virus transmitte
From: Stefan Bodewig []
Sent: 31 August 2013 06:59
Subject: Re: Use of XML Catalog with Ant (xslt task) - request for example

On 2013-08-30, Kerry, Richard wrote:

> I'm still unclear about this.  Internally within Ant there seems to be
> a Classpath that is some combination of CLASSPATH environment
> variable, -cp parameter, <classpath>, <path id="classpath" >, <path
> id="class.path" >. <xslt ><classpath /></xslt>.

> Which one can/should I put my resolver's location in ?

<path id="..."/> just defines a PATH like structure.  Whether it
contributes to loading a class or not completely depends on where it is
used - if at all - via refid.  <path id> defines a global variable but
its id doesn't have any special meaning to Ant.

Whether you put classes into $CLASSPATH or -cp into -lib or $ANT_HOME/lib
or into nested <classpath> elements influences which classloaders they
end up in and what you can do with them.  Say jar A needs jar B and you
place jar A in $CLASSPATH then it will not find B if it isn't part of
$CLASSPATH as well even if you use -lib as $CLASSPATH populates the
system classloader and -lib a child of the system classloader that is
invisible to classes loaded via the system classloader.

Some general hints:

* don't use -cp at all.  Use the wrapper script shipping with Ant and
  one of the other options.

* don't try to mix where you place your jars that depend on each other.
  In the case of ant-resolver.jar and xml-resolver.jar I'd recommend to
  put them both into $ANT_HOME/lib or use -lib (this is equivalent) but
  never split them.  The alternative is to not put them into
  ANT_HOME/lib but use a nested <classpath> holding both of them

* if you find yourself having to specify -lib all the time, use


To unsubscribe, e-mail:
For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message