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 13270 - Exception when disabling modules.
Summary: Exception when disabling modules.
Status: CLOSED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 3.x
Hardware: Sun Solaris
: P3 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-06-28 13:02 UTC by Jan Zajicek
Modified: 2008-12-23 11:16 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
an exception (2.97 KB, text/plain)
2001-07-20 20:38 UTC, Jan Zajicek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Zajicek 2001-06-28 13:02:53 UTC
See exception in attachmet. This seem not like an issue from the JDBC module
because the exception is thrown when instantiating jdbcwizard action, the action
is defined in layers, so why it is instantiated when the module is already
disabled? Seems to me like race condition.
Comment 1 Jan Zajicek 2001-06-28 13:03:39 UTC
Created attachment 1766 [details]
an exception
Comment 2 Jesse Glick 2001-07-03 05:33:36 UTC
It is a race condition (AFAIK), but is not solvable with the current JDBC module
code; the action is created from instance, begins to be recognized in some other
thread slowly, then the module is disabled, the classloader is removed from the
system class loader, then the action is initialized and tries to load its bundle
from the systemClassLoader, which is not found. There is no way to solve that
except by loading the bundle directly from the same class loader, which ought to
be OK. In general you cannot be assured that code from your module will be
loadable from the systemClassLoader unless you control when this loading
happens, since it may be that your module has just been uninstalled.

So JdbcWizardAction should instead of this:

NbBundle.getBundle("org.netbeans.modules.jdbc.wizard.Bundle")

use this:

NbBundle.getBundle("...", Locale.getDefault(),
JdbcWizardAction.class.getClassLoader())

or more simply, avoid using the static bundle and directly call
NbBundle.getMessage(JdbcWizardAction.class, ...) which is the recommended usage
anyway.
Comment 3 Filip Rachunek 2001-07-10 08:19:04 UTC
I tried the recommended fix and it worked. It will be fixed in JDBC 
module ASAP.
Comment 4 Jan Zajicek 2001-07-10 14:34:23 UTC
I verified the fix provided by Filip and it seems to work.
Comment 5 Jesse Glick 2001-07-13 17:40:17 UTC
BTW this was probably duplicate of a core bug that was recently fixed.
NbBundle with String args should be fine unless the module is in the
process of being uninstalled, which is obscure.
Comment 6 Quality Engineering 2003-07-01 16:11:18 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.