ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeremy Aston" <...@pigbite.com>
Subject RE: xmlvalidate task and external catalogs
Date Wed, 07 Apr 2004 10:30:11 GMT
mmm...

ant-apache-resolver.jar is indeed an almost empty jar - only the manifest

as for my classpath:

     [echo]
d:\java\apache-ant-1.6.1\lib\ant-launcher.jar;d:\java\xerces-2_6_2\r
esolver.jar;C:\Program
Files\Altova\xmlspy\XMLSpyInterface.jar;d:\java\xml-commo
ns-resolver-1.1\resolver.jar;D:\java\apache-ant-1.6.1\lib\ant-antlr.jar;D:\j
ava\
apache-ant-1.6.1\lib\ant-apache-bsf.jar;D:\java\apache-ant-1.6.1\lib\ant-apa
che-
resolver.jar;D:\java\apache-ant-1.6.1\lib\ant-commons-logging.jar;D:\java\ap
ache
-ant-1.6.1\lib\ant-commons-net.jar;D:\java\apache-ant-1.6.1\lib\ant-icontrac
t.ja
r;D:\java\apache-ant-1.6.1\lib\ant-jai.jar;D:\java\apache-ant-1.6.1\lib\ant-
jaka
rta-bcel.jar;D:\java\apache-ant-1.6.1\lib\ant-jakarta-log4j.jar;D:\java\apac
he-a
nt-1.6.1\lib\ant-jakarta-oro.jar;D:\java\apache-ant-1.6.1\lib\ant-jakarta-re
gexp
.jar;D:\java\apache-ant-1.6.1\lib\ant-javamail.jar;D:\java\apache-ant-1.6.1\
lib\
ant-jdepend.jar;D:\java\apache-ant-1.6.1\lib\ant-jmf.jar;D:\java\apache-ant-
1.6.
1\lib\ant-jsch.jar;D:\java\apache-ant-1.6.1\lib\ant-junit.jar;D:\java\apache
-ant
-1.6.1\lib\ant-launcher.jar;D:\java\apache-ant-1.6.1\lib\ant-netrexx.jar;D:\
java
\apache-ant-1.6.1\lib\ant-nodeps.jar;D:\java\apache-ant-1.6.1\lib\ant-starte
am.j
ar;D:\java\apache-ant-1.6.1\lib\ant-stylebook.jar;D:\java\apache-ant-1.6.1\l
ib\a
nt-swing.jar;D:\java\apache-ant-1.6.1\lib\ant-trax.jar;D:\java\apache-ant-1.
6.1\
lib\ant-vaj.jar;D:\java\apache-ant-1.6.1\lib\ant-weblogic.jar;D:\java\apache
-ant
-1.6.1\lib\ant-xalan1.jar;D:\java\apache-ant-1.6.1\lib\ant-xalan2.jar;D:\jav
a\ap
ache-ant-1.6.1\lib\ant-xslp.jar;D:\java\apache-ant-1.6.1\lib\ant.jar;D:\java
\apa
che-ant-1.6.1\lib\resolver.jar;D:\java\apache-ant-1.6.1\lib\xercesImpl.jar;D
:\ja
va\apache-ant-1.6.1\lib\xml-apis.jar;d:\java\j2SDK1.4.2_03\lib\tools.jar

resolver.jar is in there there twice.  The first time (the one after xmlspy)
is as a result of me changing my own system environment cp.  It then picks
up a copy that I plonked in the ant lib folder for good measure.
Interestingly enough the one specifed with the -lib arg is not being
referenced.

Is ant-apache-resolver.jar something that is required in addition to
resolver.jar or are they effectively the same?  I am assuming the former is
true.

Rgds

Jeremy



-----Original Message-----
From: Stefan Bodewig [mailto:bodewig@apache.org]
Sent: 07 April 2004 10:58
To: user@ant.apache.org
Subject: Re: xmlvalidate task and external catalogs


On Wed, 7 Apr 2004, Jeremy Aston <jez@pigbite.com> wrote:

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

<snip/>

> [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
see.

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

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

Stefan

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



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


Mime
View raw message