Bug 535658 (RHQ-2330) - what happens if a discovery component changes the list of additional classpath URLs?
Summary: what happens if a discovery component changes the list of additional classpat...
Keywords:
Status: CLOSED WONTFIX
Alias: RHQ-2330
Product: RHQ Project
Classification: Other
Component: Plugin Container
Version: unspecified
Hardware: All
OS: All
medium
medium
Target Milestone: ---
: ---
Assignee: RHQ Project Maintainer
QA Contact:
URL: http://jira.rhq-project.org/browse/RH...
Whiteboard:
Depends On:
Blocks: rhq_triage
TreeView+ depends on / blocked
 
Reported: 2009-08-11 15:29 UTC by John Mazzitelli
Modified: 2014-05-09 15:39 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-05-09 15:39:01 UTC
Embargoed:


Attachments (Terms of Use)

Description John Mazzitelli 2009-08-11 15:29:00 UTC
In this method:

   org.rhq.core.pc.plugin.PluginComponentFactory.getResourceClassloader(Resource)

there is this:

            // get the classloader the resource should use
            List<URL> additionalJars = askDiscoveryComponentForAdditionalClasspathUrls(resource, parentContainer);
            ClassLoader cl = classLoaderMgr.obtainResourceClassLoader(resource, parentContainer, additionalJars);
            return cl;

The classloader manager will actually obtain the classloader from the cache if it was already created. So, technically, we are doing extra work by calling "askDiscoveryComponentForAdditionalClasspathUrls" after the first time - but it doesn't hurt anything. However, what happens if the discovery component actually returns a different set of URLs? For example, what if the resource changed the location of its client jars (perhaps a change to plugin configuration?). In this case, it will actually get the wrong classloader back because the cached classloader will have the old classpath URLs, not the new ones. We need a way to say, "this discovery component gave us a different set of URLs from before, throw away the old classloader, remove it from the cache, and create a new one with the new URLs".

Today, I don't think this is a problem because in all the places we use this code flow, the additional classpath URLs will never change (the plugin configuration for jboss-as-5 will never change the location of the jboss install dir, AFAIK). But it is conceivable that some other plugin implementation may change the additional classpath URLs - we'll need to fix this issue if that use-case ever comes up.


Comment 1 Red Hat Bugzilla 2009-11-10 21:02:21 UTC
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-2330


Comment 2 wes hayutin 2010-02-16 16:52:24 UTC
Temporarily adding the keyword "SubBug" so we can be sure we have accounted for all the bugs.

keyword:
new = Tracking + FutureFeature + SubBug

Comment 3 wes hayutin 2010-02-16 16:58:12 UTC
making sure we're not missing any bugs in rhq_triage

Comment 4 Corey Welton 2010-11-22 18:10:35 UTC
Triaged 17-Nov

Comment 5 Jay Shaughnessy 2014-05-09 15:39:01 UTC
The code seems the same but the issue has not come up in over 4 years, it seems.  So, closing.


Note You need to log in before you can comment on or make changes to this bug.