The problem is that each plugin has its own class loader, and Hibernate uses Reflection to find the right classes.
I have a very good article at home about a specific problem, but it is in German. I will try to explain what you need to do.
To have a data structure shared by several plugins, you must put it in the plugin and enable a function called buddy policy . Suppose you have a main-application-plugin that starts hibernation at startup, this plugin should “see” the classes from the datastructure plugin. To do this , the main plugin sets its Buddy-Policy to “registered”, and the datastructure plugin registers as a “buddy” . Unfortunately, you have to do this directly in the manifest file, at least in 3.3, there was no way in the editor to do this.
Once this policy works, Hibernate will also be.
I looked through my old application and this is how I did it.
- The main application (toolseye.rcp) depends on the hibernate plugin (de.eye4eye.hibernate) and the datastructure-plugin plugin (toolseye.datastructures)
- The hibernate plugin defines its friend policy as "registered"
- The datastructure module connects to the sleep plugin
Here are the important lines:
Hibernate-plugin de.eye4eye.hibernate
Eclipse-BuddyPolicy: registered
Tool files with tool structures.
Eclipse-RegisterBuddy: de.eye4eye.hibernate
Put this line directly in MANIFEST.MF
Both plugins must re-export their packages so that the main application or any other layer that you have between them can use them. Hope this helps.
source share