Web Start Xerces Issue [message #734180] |
Thu, 06 October 2011 19:46  |
Eclipse User |
|
|
|
I have an 3.6.2 RCP app that explicitly calls into Xerces XNI classes.
Launched through Eclipse, it works fine. When launched through WebStart, I get an error when my XNI code is called. Other XML parsing works fine (would not have started up if it didn't.)
DTD factory class org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl does not extend from DTDDVFactory.
I've tried adding property suggested here, but no luck. www.eclipse.org/forums/index.php/t/142863/
Can't figure out why it bahaves differently in WebStart.
|
|
|
Re: Web Start Xerces Issue [message #754125 is a reply to message #734180] |
Mon, 31 October 2011 19:02  |
Eclipse User |
|
|
|
I think I've found the solution, but it's not pretty.
First, I think it's possible that the osgi.contextClassLoaderParent parameter is no longer supported in Helios. It was added in 3.2. Have thrown a debug line into my code where I'm setting up my Xerces instance.
System.out.println(Thread.currentThread().getContextClassLoader().toString());
No matter what I set the osgi.contextClassLoaderParent to (app, ext, boot, fwk, ccl), I get com.sun.jnlp.JNLPClassLoader from WebStart. When I launch the same app in Eclipse, I get org.eclipse.core.runtime.internal.adaptor.ContextFinder.
I believe this is the source of my problem. THe JNLPClassLoader is loading a version of Xerces that is in conflict with the version that my bundle is configured to run.
I can play a trick and pass a reference to the Eclipse classloader in, and set the context classloader on the thread, but that's pretty ugly:
Thread.currentThread().setContextClassLoader(_classLoader);
Am I correct that osgi.contextClassLoaderParent dropped out of Helios?
|
|
|
Powered by
FUDForum. Page generated in 0.05304 seconds