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 72718 - Bean's methods invoked in thread with invalid context classloader
Summary: Bean's methods invoked in thread with invalid context classloader
Status: NEW
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-16 11:08 UTC by Jan Stola
Modified: 2013-08-20 17:11 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Stola 2006-02-16 11:08:54 UTC
The constructor of the bean and its getters and setters are invoked
in the event-dispatch thread with the context classloader set to NetBeans
system classloader. This causes problems to beans that try to utilize
thread's context classloader (like DriverManager invoked through
RowSet.execute()).

We cannot set the context classloader for all invocations (e.g. painting
methods), but we should consider temporary setting of the context classloader
when invoking constructor and setters.
Comment 1 Jan Stola 2008-01-10 14:39:14 UTC
Noone reported issue caused by this imperfection. So, it doesn't seem to cause problems in real-world forms => changing 
to enhancement.
Comment 2 Tomas Pavek 2013-08-20 17:11:27 UTC
Bug 231916 would need this context classloader - to be able to load Hibernate copies for particular user projects, which seemed to work (kind of) when experimenting with it, but this example is not a suitable case either as Hibernate is too big to be fooled this way (not designed for such use), easy to fail on something else.

But the idea of setting the context classloader to the project class loader when instantiating beans (or executing any code in FormLAF block) seems generally reasonable.