Classloader conflicts with JAXP in plugin using Xalan [message #591554] |
Wed, 12 March 2003 22:49 |
Peter Nehrer Messages: 241 Registered: July 2009 |
Senior Member |
|
|
Hi, I'm writing a search plugin that uses Xalan to perform some
transformations (during the course of the search). The actual
transformation is encapsulated in a class/method outside of the plugin
package (but is part of the plugin project and jar). Initially I
provided my own xalan.jar, xml-apis.jar, and xercesImpl.jar as a runtime
dependency. My unit test works fine (i.e., performs a transformation OK,
running as a standalone Java app using the same classpath as used by the
plugin). However, I get classloader exceptions trying to use it from
within my plugin; some of the JAXP classes are already loaded by the
classloader. Fine, I removed the conflicting classes from my
xml-apis.jar and got rid of xercesImpl.jar (which was also conflicting
w/ Xerces used by Eclipse). Now, however, Xalan reports validation
exceptions when loading the stylesheet (I suspect this version of Xalan
doesn't agree w/ the version of Xerces used by Eclipse).
Is there a way to avoid these conflicts? Can my plugin get a "private"
classloader and thus its own versions of these (JAXP and Xerces)
classes? Is this because the code that tries to do this is run from the
Search Dialog?
I'd appreciate if anyone could shed some light on this. What are the
Eclipse rules regarding class loaders? This topic is a nightmare in Ant,
especially in taskdefs dealing w/ XML/JAXP. Thank you!
--Peter
|
|
|
Powered by
FUDForum. Page generated in 0.02661 seconds