Sorry, I see from some of the Tomcat source that getURLs is not delegated.
Therefore, to get a picture of the full effictive classpath, you would need
to do something like this:

    ClassLoader loader = Thread.currentThread().getContextClassLoader();
    while (loader != null) {
        if (loader instanceof URLClassLoader) {
            URL[] urls = ((URLClassLoader) loader).getURLs();
            for (int i = 0; i < urls.length; i++)
                System.err.println(urls[i]);
        }
        loader = loader.getParent();
    }
    loader = ClassLoader.getSystemClassLoader();
    if (loader instanceof URLClassLoader) {
       URL[] urls = ((URLClassLoader) loader).getURLs();
        for (int i = 0; i < urls.length; i++)
            System.err.println(urls[i]);
    }

However, it may well be that the output would just be the soap.jar you
previously got plus the system classpath.

If you want to try to force use of Xerces, you could try putting xerces.jar
in the WEB-INF/lib directory.

Also, you might find the debugging built into Tomcat to be of use.  In the
Tomcat docs (J:\jakarta-tomcat-4.0-b6\webapps\ROOT\docs\appdev\index.html on
my win2k box), you'll see that you can set debug within the <context> in
server.xml.  While the docs speak of debug during initialization, etc., the
class loader code has debugging within it that I would hope is activated as
well.

>>>>
a.. Add a new <Context> element for your application, using the existing
examples as a guide. The following attributes are supported:
  a.. path. The context path for your application, which is the prefix of a
request URI that tells Tomcat which application should be used to process
this request. For example, if you set your path to "/catalog", any request
URI beginning with "/catalog" will be processed by this application. This
attribute is requrired, and must start with a slash ('/') character.
  b.. docBase. The document root directory for this web application. This
can be a relative path (relative to the directory in which Tomcat is
started), or an absolute path, to the directory containing your app. On a
Windows platform, you MUST use the drive prefix and a colon when specifying
an absolute path. This attribute is required.
  c.. debug. Debugging detail level (from "0" to "9") that defines how
verbose Tomcat's logging messages will be when your application is
initialized, started, and shut down. The default value is "0" (minimal
logging) if you do not specify a different value.
  d.. reloadable. Set to "true" if you want Tomcat to watch for changes to
Java class files in the WEB-INF/classes directory, or JAR files in the
WEB-INF/lib directory. If such a change is noted, Tomcat will shut down and
reload your application automatically, picking up these changes. The default
value ("false") means that such changes will be ignored. NOTE: While this
feature is very useful during development, it requires overhead to do the
checking. This capability should generally not be used in deployed
production applications.
<<<<

Scott

----- Original Message -----
From: "David Turner" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 31, 2001 9:40 AM
Subject: Re: Parsing error...


> Hi Scott,
>
> I tried getting the classpath used by the class loader via the code you
> recommended and it returned the following only:
>
> file:/a/franklin/fg/softdev/lib/soap-2_2/webapps/soap/WEB-INF/lib/soap.jar
>
>
>
> Scott Nichol wrote:
>
> > Have you determined the classpath in use by the class loader for the
thread
> > on which your servlet is running?  The contents of java.class.path in
the
> > System properties need not have any relationship to this.
> >
> > Scott
> >
> > ----- Original Message -----
> > From: "David Turner" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Monday, July 30, 2001 4:18 PM
> > Subject: Re: Parsing error...
> >
> > > In RPCRouterServlet I checked the class of the document builder being
> > returned
> > > by XMLParserUtils.getXMLDocBuilder() and it's as follows:
> > >     xdb documentBuilder class type = class
> > > org.apache.crimson.jaxp.DocumentBuilderImpl
> > >
> > > I don't understand why the crimson version one is being used when I
have
> > xerces
> > > as my parser.  My classpath looks right.
> > > Does anybody know why this is happening?
> > >
> > >
> > > Scott Nichol wrote:
> > >
> > > > The classpath being used by the class loader is different than the
> > System
> > > > properties classpath.  Tomcat creates several class loaders,
including a
> > > > separate class loader for each servlet.  The class loader for each
> > servlet
> > > > will include stuff in WEB-INF for that servlet.  That is why dumping
the
> > > > effective classpath for the thread on which the servlet is running
would
> > be
> > > > interesting.
> > > >
> > > > However, it seems like your debugging is getting close enough to the
> > problem
> > > > that you should probably follow that path.  Whether the different
JDKs
> > are
> > > > the cause of the problem will likely be best determined this way.
> > > >
> > > > Scott
> > > >
> > > > ----- Original Message -----
> > > > From: "David Turner" <[EMAIL PROTECTED]>
> > > > To: <[EMAIL PROTECTED]>
> > > > Sent: Friday, July 27, 2001 11:30 AM
> > > > Subject: Re: Parsing error...
> > > >
> > > > > Scott,
> > > > > I dumped the System environment variables and I don't see anything
> > > > unusual.
> > > > >
> > > > > Also,  One thing I completely forgot to mention is that the
version
> > that I
> > > > got
> > > > > working (Linux and Win) I used JDK1.4.0beta.  Here I'm using
JDK1.3.0.
> > > > That
> > > > > shouldn't have anything to do with it, right?
> > > > >
> > > > >
> > > > >
> > > > > java.runtime.name=Java(TM) 2 Runtime Environment, Standard
Edition,
> > > > >  sun.boot.library.path=/usr/opt/java130/jre/lib/alpha,
> > > > > java.vm.version=1.3.0-1.p1,
> > > > > java.vm.vendor=Compaq Computer Corp.,
> > > > > java.vendor.url=http://www.compaq.com/java,
> > > > > path.separator=:,
> > > > > java.vm.name=Classic VM,
> > > > > file.encoding.pkg=sun.io,
> > > > > java.vm.specification.name=Java Virtual Machine Specification,
> > > > > user.dir=/a/franklin/home/franklin/turner/tomcat4.0/bin,
> > > > > java.runtime.version=1.3.0-1.p1,
> > > > > java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment,
> > > > > os.arch=alpha,
> > > > > java.io.tmpdir=/tmp/,
> > > > > line.separator=
> > > > > java.vm.specification.vendor=Sun Microsystems Inc.,
> > > > > java.naming.factory.url.pkgs=org.apache.naming,
> > > > > java.awt.fonts=,
> > > > > os.name=OSF1,
> > > > >
> > > > >
> > > >
> >
java.library.path=/usr/opt/java130/bin/../jre/lib/alpha/classic:/usr/opt/jav
> > > >
> >
a130/bin/../jre/lib/alpha/native_threads:/usr/opt/java130/bin/../jre/lib/alp
> > > >
> >
ha::/usr/opt/java130/bin/../jre/../lib/alpha:/util/sybase/lib:/humgen/softwa
> > > >
> >
re/lib:/seq/software/Staden.05_97/lib/alpha-binaries:/util/lib:/util/sybase/
> > > >
> >
lib:/util/oracle/lib:/usr/shlib:/usr/local/lib:/util/oracle/lib:/usr/lib:/us
> > > > r/shlib,
> > > > >
> > > > > java.specification.name=Java Platform API Specification,
> > > > > java.class.version=47.0,
> > > > > os.version=V4.0,
> > > > > user.home=/home/franklin/turner,
> > > > > catalina.useNaming=true,
> > > > > user.timezone=GMT-05:00,
> > > > > java.awt.printerjob=sun.awt.motif.PSPrinterJob,
> > > > > file.encoding=ISO8859-1,
> > > > > java.specification.version=1.3,
> > > > > catalina.home=./..,
> > > > >
> > > > >
> > > >
> >
java.class.path=/fg/softdev/lib/xerces-1_4_1/xerces.jar:/fg/softdev/lib/jaxp
> > >
> >
> -1.1/jaxp.jar:./../bin/bootstrap.jar:./../bin/servlet.jar:./../bin/naming.
> > ja
> > > > r:/usr/opt/java130/lib/tools.jar,
> > > > >
> > > > > user.name=turner,
> > > > >
> >
java.naming.factory.initial=org.apache.naming.java.javaURLContextFactory,
> > > > > java.vm.specification.version=1.0,
> > > > > java.home=/usr/opt/java130/jre,
> > > > > user.language=en,
> > > > > java.specification.vendor=Sun Microsystems Inc.,
> > > > > java.vm.info=native threads, jit,
> > > > > java.version=1.3.0,
> > > > > java.ext.dirs=/usr/opt/java130/jre/lib/ext,
> > > > >
> > > >
> >
sun.boot.class.path=/usr/opt/java130/jre/lib/rt.jar:/usr/opt/java130/jre/lib
> > > >
> >
/i18n.jar:/usr/opt/java130/jre/lib/sunrsasign.jar:/usr/opt/java130/jre/class
> > > > es,
> > > > >
> > > > > java.vendor=Compaq Computer Corp.,
> > > > > file.separator=/,
> > > > > java.vendor.url.bug=http://www.compaq.com/java/contact/index.html,
> > > > > java.compiler=jit_130,
> > > > > sun.io.unicode.encoding=UnicodeBig,
> > > > > sun.cpu.endian=little,
> > > > > sun.cpu.isalist=
> > > > >
> > > > >
> > > > > Scott Nichol wrote:
> > > > >
> > > > > > > Or a simpler thing to do at any point would be something like
> > > > > > >
> > > > > > >     ClassLoader loader =
> > > > Thread.currentThread().getContextClassLoader();
> > > > > > >     if (loader instanceof URLClassLoader) {
> > > > > > >         URL[] urls = loader.getURLs();
> > > > > >
> > > > > > Make that
> > > > > >           URL[] urls = ((URLClassLoader)loader).getURLs();
> > > > > >
> > > > > > >         for (int i = 0; i < urls.length; i++)
> > > > > > >             System.out.println(urls[i]);
> > > > > > >     }
> > > > > > >
> > > > > > > I'm not 100% certain this will work, but it seems worth a try
just
> > to
> > > > see
> > > > > > > what the classpath looks like.
> > > > > >
> > > > > > Scott
> > > > >
> > > > > --
> > > > > David Turner <[EMAIL PROTECTED]>
> > > > > Senior Software Engineer
> > > > > Whitehead Institute/MIT Center for Genome Research
> > > > > One Kendall Square, Bldg. 300
> > > > > Cambridge, MA 02139-1561 USA
> > > > > phone 617-252-1573 / fax 617-252-1902
> > > > >
> > > > >
> > >
> > > --
> > > David Turner <[EMAIL PROTECTED]>
> > > Senior Software Engineer
> > > Whitehead Institute/MIT Center for Genome Research
> > > One Kendall Square, Bldg. 300
> > > Cambridge, MA 02139-1561 USA
> > > phone 617-252-1573 / fax 617-252-1902
> > >
> > >
> > >
>
> --
> David Turner <[EMAIL PROTECTED]>
> Senior Software Engineer
> Whitehead Institute/MIT Center for Genome Research
> One Kendall Square, Bldg. 300
> Cambridge, MA 02139-1561 USA
> phone 617-252-1573 / fax 617-252-1902
>
>

Reply via email to