Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 327418 - Support Buddy Class Loading on virgo
Summary: Support Buddy Class Loading on virgo
Status: CLOSED WONTFIX
Alias: None
Product: Virgo
Classification: RT
Component: unknown (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-11 03:29 EDT by Thomas Kratz CLA
Modified: 2010-10-11 04:45 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Kratz CLA 2010-10-11 03:29:21 EDT
Build Identifier: M6 incubation

Coming from eclipse I am used to solve some problems (esp regarding hibernate) with buddy class loading and I found that this does not work on virgo. I do not know how this is implemented in eclipse, but maybe its not a great effort to take that into virgo. I guess Buddy Class loading is a little bit more specific than import-scope:application which one does not always want.

Reproducible: Always
Comment 1 Glyn Normington CLA 2010-10-11 03:57:58 EDT
Virgo's notion of a scoped application is much more robust that buddy class loading, which is really a hack. Buddy class loading latches on to what appears to be a suitable bundle but does not pay much attention to versioning and so is unreliable in any situation where there are multiple bundles exporting the package of the class being loaded. The Equinox committers accept the hackiness of buddy class loading, so it's not NIH on the part of Virgo.

Essentially the bundles in a scope (i.e. a PAR file or a scoped plan) have all their exports imported by a generated bundle known as the synthetic context bundle and this bundle's class loader is used as the TCCL by the bundles in the scope.

So buddy class loading is not supported. If there is a scenario which scopes do not address and which buddy class loading appears to address, please construct a test case to reproduce and feel free to reopen this bug.
Comment 2 Thomas Kratz CLA 2010-10-11 04:30:26 EDT
Hi Glyn thanks for clearifying this. I am just getting started.
But how do I solve this :

I have a services bundle that contains an entity-update-listener that hibernate wants to load. As the package is imported from nowhere its not visible to hibernate.

As far as I understodd it by now I would have to create a dummy bundle that imports with scope:application, is this right or is there a better way to achieve this ?
Comment 3 Glyn Normington CLA 2010-10-11 04:42:17 EDT
If I've understood correctly and the services bundle is part of a PAR or a scoped plan, you just need to export the package of the entity update listener from the services bundle so that it will be visible to hibernate for thread context class loading.
Comment 4 Thomas Kratz CLA 2010-10-11 04:45:19 EDT
I'll have to learn what "scoped plan" means :) Maybe I have to change something in my plan. Thanks for helping so quickly.