DZone Forums
Go Back   DZone Forums > Community > Tools & IDEs > Eclipse
Reload this Page Eclipse plugins classloader!
Notices
Reply
 
LinkBack Thread Tools Display Modes
  (#1 (permalink)) Old
Member
 
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Join Date: Jun 2009
Lightbulb Eclipse plugins classloader! - 06-23-2009, 04:34 AM

Hi all
Recently I've developed an eclipse plugin which actullay is an oda extension for birt.(and you may know that birt is a reporting application based on eclipse!) and I face this problem of classloading.
There we have some classes (which has to transfer data to/from database) in our j2ee application (deploys on a jboss server) and in my plugin I need to call them and access them.I deploy the platform (contains plugins,configuration,...) in WEB-INF directory of my war file so when the server runs it loads the platform and also my plugin.But as you may guess I cannot see my classes from my plugin.
(It's like a rat in a box!even if the cheese is in the same room as the box but rat cannot access it because he always search the box!How can I say rat to search outside the box for your cheese?)
Reply With Quote
  (#2 (permalink)) Old
Member
 
Posts: 17
Thanks: 1
Thanked 2 Times in 2 Posts
Join Date: Jan 2009
Default 06-24-2009, 04:13 AM

Hi,

I think in your MANIFEST.MF, you have to register buddies. In your main plugin insert the line "Eclipse-BuddyPolicy: registered". Into the other plugins that have to access the same classloader insert "Eclipse-RegisterBuddy: some.other.plugin" with the name of your plugin replacing "some.other.plugin".

Hope that helps.
Good luck,
Heiko
Reply With Quote
The Following User Says Thank You to hmausolf For This Useful Post:
alirezasa (06-27-2009)
  (#3 (permalink)) Old
Member
 
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Join Date: Jun 2009
Default 06-27-2009, 02:02 AM

hi,Heiko and thanks for your attention.
There is a problem with your suggested solution and it is:
the other plugins (you've mentioned) our my application main classes which I have to use them in so many places.(Not only in my plugin)I've tested your solution but then I cannot deploy my war file and jboss cannot instantiate my classes.
Reply With Quote
  (#4 (permalink)) Old
Active Contributor
 
Posts: 62
Thanks: 0
Thanked 6 Times in 6 Posts
Join Date: Jun 2009
Default 06-29-2009, 04:34 AM

hi, alirezasa

In my opinion, you can process it in the code, when you are using some certain class, you can utilize the main class of the plugin to get the class loader of the plugin (use the getPluginClassLoader() method), then call the loadClass() method to load the certain class.

wish it could be helpful.


www.eclaxy.com
let's perfect the eclipse!
Reply With Quote
  (#5 (permalink)) Old
Active Contributor
 
Posts: 62
Thanks: 0
Thanked 6 Times in 6 Posts
Join Date: Jun 2009
Default 06-29-2009, 04:44 AM

hi, alirezasa

In my opinion, you can process it in the code, when you are using some certain class, you can utilize the main class of the plugin to get the class loader of the plugin (use the getPluginClassLoader() method), then call the loadClass() method to load the certain class.

wish it could be helpful.


www.eclaxy.com
let's perfect the eclipse!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Eclipse plugins h3ll Eclipse 4 06-18-2009 05:44 AM
How are you writing plugins for eclipse? lenik Eclipse 1 01-27-2009 06:27 AM
plugins in eclipse rcp baksheen Eclipse 0 12-04-2008 02:42 AM
problem with classloader from plugin nev.clark Eclipse 9 09-30-2008 02:54 PM
eclipse plugins jaydhar Eclipse 0 09-04-2008 07:32 PM


Copyright 1997-2009, DZone, Inc.
vBulletin Skin developed by: vBStyles.com