Hello. I have a similar (or maybe it's the same) problem I'm trying to
solve.
We want to deploy a servlet which does some XML parsing and transformations
using Xerces-Java and Xalan-Java and runs under the Jakarta Tomcat 3.2.1
servlet engine.
We want to insure there will never be a conflict with any other customer's
servlet
which might use a different XML parser and XSLT enginer, e.g., the JAXP
1.0.1 bundled
with Tomcat 3.2.1.
I have a question about loading JAR files.
Is there a way for a Java application (like my servlet) to dynamically load
specific versions of JAR files (in my case, Xerces-J and Xalan-J)
independent of
what is specified in the CLASSPATH, so that all
references to classes implemented in these JAR files (but possibly
implemented in other JAR files contained within the CLASSPATH) are
guaranteed to be
resolved by classes contained within the specific, dynamically loaded JAR
files
and not from some other JAR files specified in the CLASSPATH.
I am looking for a Java facility for JAR files which is analogous to
dynamically loading C and C++ libraries on
Sun Solaris using dlopen or on Windows using the Win32 API function
LoadLibrary.
Can it be done with the java.lang.ClassLoader or some other standard
classes?
Can someone point me to some sample code which demonstrates how to do this?
Thanks.
Barry Draper
[EMAIL PROTECTED]
-----Original Message-----
From: Shane Curcuru [mailto:[EMAIL PROTECTED]]
Sent: Sunday, June 03, 2001 8:58 PM
To: [EMAIL PROTECTED]
Subject: Re: Problems with TransformerImpl.transform
Actually if you have a fairly standalone sample that
does this (uses a special classloader to get around
these issues) it would be very helpful to post to this
list. The incorrect JAXP or other SAX/DOM classes is
a very common problem, and I bet a few people would be
interested.
Thanks,
Shane
---- you Alan Canon <[EMAIL PROTECTED]>
wrote----
> You may have to use a customer URLClassLoader to
pull the classes
>you need out of javax.xml.transform, etc., and use
Method.invoke()
> from java.lang.reflect to manipulate the custom
loaded classes.
> A pain, but it works, and I have sample code if you
need it.
=====
<eof aka="mailto:[EMAIL PROTECTED]"
humor="Having fun at JavaOne!" />
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year! http://personal.mail.yahoo.com/