|
|
Re: Class loading in SWT Event Thread [message #1125152 is a reply to message #1125078] |
Fri, 04 October 2013 07:55 |
Jan Krakora Messages: 477 Registered: December 2009 Location: Prague |
Senior Member |
|
|
Well, my problem is in using lambdaj on the SWT Event thread.
Let's say I have:
- plugin A containing MyClass
- plugin B containing ByClassB that define the code below
- com.google.lambdaj plugin
- plugin B has dependency on plugin com.google.lambdaj
- plugin B has also dependency on plugin A, so it can use its MyClass
lambdaj internally uses the cglib to create proxy classes. So when I have something like this:
Display.getDefault().asyncExec(new Runnable() {
public void run() {
MyClass class = Lambda.selectFirst(collection, having(on(MyClass.class).getId(), Matchers.equalTo(id)));
....
}
)};
I get "java.lang.ClassNotFoundException: net.sf.cglib.proxy.Factory". When I debug it and look at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(...),
I can see the plugin that is looking for the net.sf.cglib.proxy.Factory class is the A plugin.
Since I can't modify the com.google.lambdaj plugin, the only workaround was to put Eclipse-BuddyPolicy: global in my A plugin.
This is AFAIK bad solution because it then looks for the class in all exported packages from the whole RCP application.
The fact that my code runs on the SWT Event thread is maybe irrelevant.
[Updated on: Fri, 04 October 2013 08:06] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03673 seconds