This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 191170 - Thread.contextClassLoader does not see resources from all started bundles
Summary: Thread.contextClassLoader does not see resources from all started bundles
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Netigso (show other bugs)
Version: 6.x
Hardware: Other Linux
: P1 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-20 10:48 UTC by Jaroslav Tulach
Modified: 2010-10-29 14:03 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2010-10-20 10:48:41 UTC
Similar to bug 190822. 

In case one uses Bundle.start() directly, without going through recommended
NetBeans Module APIs for enabling modules, one can reach a state, when there
are active bundles, with valid classloaders, but the
Thread.currentThread().getContextClassLoader() does not see them.

This may cause problems with libraries that rely on Thread.contextClassLoader
to see everything in the application and want to access some resources via Thread.contextClassLoader.getResource(...).
Comment 1 Jaroslav Tulach 2010-10-20 12:08:10 UTC
core-main#06e630216c9e
Comment 2 Jaroslav Tulach 2010-10-20 12:31:22 UTC
Merged into release692 as 071aeefc4126
Comment 3 Marian Mirilovic 2010-10-21 09:00:59 UTC
Jarda, 
could you please help us with verification of this issue in NB 6.9.1 + patch 2 ? Thanks in advance.
Comment 4 Jaroslav Tulach 2010-10-22 09:02:37 UTC
There is additional problem with ClassLoader.getResources. That method needs to be overridden as well. I fixed that as core-main#d7dd63584cec (and this fix will be available for NetBeans 7.0).

I can confirm that with this additional fix the sample application that I am testing runs fine. It would be nice if I could backport d7dd63584cec to some patch for 6.9.x however.
Comment 5 Tomas Danek 2010-10-25 07:33:16 UTC
marking verified, based on comment.
Comment 6 Jaroslav Tulach 2010-10-25 12:15:02 UTC
We still should backport changeset d7dd63584cec
Comment 7 Jaroslav Tulach 2010-10-26 15:45:04 UTC
Merged to 6.9.2 as releases#5aded2364a10
Comment 8 Jaroslav Tulach 2010-10-29 13:56:22 UTC
I can confirm that now the application that used to have problems runs OK.