I avoid the same problem by put following code:
Class<?> clazz = Class.forName(this.getClass().getName());
Thread thread = Thread.currentThread();
ClassLoader classLoaderThread = thread.getContextClassLoader();
System.out.println("ClassLoader for Thread : " + classLoaderThread);
ClassLoader classLoaderClass = clazz.getClassLoader();
System.out.println("ClassLoader for Class : " + classLoaderClass);
thread.setContextClassLoader(classLoaderClass);
before the "context.lookup".
This change:
ClassLoader for Thread : org.eclipse.core.runtime.internal.adaptor.ContextFinder_at_1970ae0
to:
ClassLoader for Class : org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader_at_d19bc8
and works (at least in my case).
Best regards
Piotrek
[Message sent by forum member 'pichur']
http://forums.java.net/jive/thread.jspa?messageID=484879