Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 360671 - Synthetic context class loader is not set as TCCL
Summary: Synthetic context class loader is not set as TCCL
Status: CLOSED FIXED
Alias: None
Product: Virgo
Classification: RT
Component: runtime (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Glyn Normington CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 360965 361635
  Show dependency tree
 
Reported: 2011-10-12 10:27 EDT by Glyn Normington CLA
Modified: 2011-10-21 07:24 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Glyn Normington CLA 2011-10-12 10:27:08 EDT
A new testcase SyntheticContextTCCLIntegrationTests consists of a PAR which invokes a static method ("run") in a bundle outside the PAR. The run method attempts to load a class of a package exported by a bundle in the PAR using the current thread context class loader (TCCL). This fails with a class load failure showing that the invoking bundle in the PAR is used to provide the TCCL rather than the synthetic context class loader.

I tested this on master and on Virgo 2.1 and dm Server 1.0.3 and it fails in each of these environments.

Possibly the function never worked, in which case I'm surprised users have not spotted this.

Opening this bug to document the behaviour and investigate further.
Comment 1 Glyn Normington CLA 2011-10-12 10:32:11 EDT
Testcase add in kernel commit 6a939c6a2d403daebe9c25ab3f7e54e5203f9765.
Comment 2 Violeta Georgieva CLA 2011-10-12 10:33:40 EDT
(In reply to comment #1)
> Testcase add in kernel commit 6a939c6a2d403daebe9c25ab3f7e54e5203f9765.

Do you think there is a connection with this bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=353897
Comment 3 Glyn Normington CLA 2011-10-12 10:42:20 EDT
(In reply to comment #2)
> (In reply to comment #1)
> > Testcase add in kernel commit 6a939c6a2d403daebe9c25ab3f7e54e5203f9765.
> 
> Do you think there is a connection with this bug
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=353897

Yes! I should have mentioned that I was working on bug 353897 when I decided to check the behaviour in the non-web case and was surprised by what I found. Thanks for pointing this out.
Comment 4 Glyn Normington CLA 2011-10-12 10:44:38 EDT
To be precise, this bug relates to the base function of thread context class loading in PARs and scoped plans. Even when this bug is fixed, I suspect web bundles in PARs and scoped plans will result in their own TCCLs and we'll still need to document that behaviour in bug 353897 (and/or fix it later in bug 353899).
Comment 5 Glyn Normington CLA 2011-10-12 10:50:58 EDT
A workaround, which users may have simply slipped into, is to import all relevant exports in the bundles in the PAR or scoped plan, but this messes up any dependency design among the bundles of the PAR or scoped plan.
Comment 6 Glyn Normington CLA 2011-10-14 10:16:05 EDT
Fixed in general, but there is still an issue with Spring DM powered bundles covered by bug 360965.

The fix is contained in kernel commits b663e72ee8eb90162f92187aca9d48839dbbd7a6 and d020dfe48ec760b8fd20176711e6b45fa283ddfa.