ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: xmlvalidate task and external catalogs
Date Wed, 07 Apr 2004 09:57:39 GMT
On Wed, 7 Apr 2004, Jeremy Aston <> wrote:

> ant -v -lib d:\java\xml-commons-resolver-1.1\resolver.jar validate


> [xmlvalidate] Validating structure.xml...
> Apache resolver library not found, internal resolver will be used
> Warning: catalogpath listing external catalogs will be ignored

So it doesn't find the resolver or the necessary Ant classes.  Let's

We need resolver.jar and ant-apache-resolver.jar, the later is in
ANT_HOME/lib and actually contains classes, right?  It could be an
almost empty jar with only a MANIFEST.MF in it, if things have gone

I've just now looked up the code inside XMLCatalog that tries to load
the Apache resolver and it looks rather wrong.  It explicitly tries to
load the resolver from the system classloader, which really shouldn't
be that way.

The Ant launcher should add everything that is in ANT_HOME/lib or
specified via -lib to the specific loader being used, but it may fail
to do so for the way the loader is being used.

Can you <echo>${java.class.path}</echo> just before your <xmlvalidate>
to see whether resolver.jar is in there?

If it isn't, then -lib is broken.

If it is, the way the classloader has been put together probably
doesn't work.  In this case, please add resolver.jar and
ant-apache-resolver.jar to your CLASSPATH environment variable and try
again.  This really just is an attempt to get control of the
situation, not something that I'd call a useful work-around.

> Interestingly enough, (but probably a btw) if I do a -diagnostics it
> tells me that...
> -------------------------------------------
>  XML Parser information
> -------------------------------------------
> XML Parser : org.apache.xerces.jaxp.SAXParserImpl
> XML Parser Location: D:\java\apache-ant-1.6.1\lib\xercesImpl.jar
> which means it is not using the jar specified in the xmlvalidate
> task.

No.  This is the parser Ant uses to parse the build file, that doesn't
say anything about the parser used by xmlvalidate (though Ant's Xerces
will very likely win there as well).


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

View raw message