Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Setting a custom classloader for my plug-in
Setting a custom classloader for my plug-in [message #811639] Fri, 02 March 2012 11:30 Go to next message
Mikael Davidsson is currently offline Mikael Davidsson
Messages: 2
Registered: March 2012
Location: Stockholm
Junior Member
Hi,

Im trying to integrate an existing app into a Eclipse plugin. The app is using a custom classloader to download requested classes over the network. However im having problems to get the plugin to use the custom classloader. Is there any way to hook the custom classloader into the plug-in's classloader chain during start-up of the plug-in? What is the recommended approach when using custom classloaders?

All my attempts so far has resulted in the following exception:
Caused by: java.lang.ClassNotFoundException: my.downloaded.stuff.MgmtUtils
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal (BundleLoader.java:513)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)

Regards
Mikael
Re: Setting a custom classloader for my plug-in [message #813943 is a reply to message #811639] Mon, 05 March 2012 16:46 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

You should look at http://wiki.eclipse.org/Adaptor_Hooks there is a classloading hook that would allow you to hook into your bundles class-loader.

PW


Re: Setting a custom classloader for my plug-in [message #813952 is a reply to message #813943] Mon, 05 March 2012 16:52 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5251
Registered: July 2009
Senior Member
If you need a running example take a look at e(fx)clipse and how it
loads JavaFX from an external resource using adapter hooks.

https://github.com/tomsontom/e-fx-clipse/tree/master/at.bestsolution.efxclipse.runtime.osgi/src/at/bestsolution/efxclipse/runtime/osgi/fxloader

Tom

Am 05.03.12 22:46, schrieb Paul Webster:
> You should look at http://wiki.eclipse.org/Adaptor_Hooks there is a
> classloading hook that would allow you to hook into your bundles
> class-loader.
>
> PW
>
Re: Setting a custom classloader for my plug-in [message #814510 is a reply to message #813952] Tue, 06 March 2012 09:40 Go to previous message
Mikael Davidsson is currently offline Mikael Davidsson
Messages: 2
Registered: March 2012
Location: Stockholm
Junior Member
Thanks

That seems to be what im looking for.

Mikael
Previous Topic:Enable/Disable menu items using source provider
Next Topic:View Tab Look
Goto Forum:
  


Current Time: Mon Jul 28 12:44:37 EDT 2014

Powered by FUDForum. Page generated in 0.02031 seconds