Skip to main content



      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
Eclipse UserFriend
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
Eclipse UserFriend
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
Eclipse UserFriend
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
Eclipse UserFriend
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: Thu Jul 24 10:39:47 EDT 2025

Powered by FUDForum. Page generated in 0.05800 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top