Red Hat Bugzilla – Bug 535658
what happens if a discovery component changes the list of additional classpath URLs?
Last modified: 2014-05-09 11:39:16 EDT
In this method:
there is this:
// get the classloader the resource should use
List<URL> additionalJars = askDiscoveryComponentForAdditionalClasspathUrls(resource, parentContainer);
ClassLoader cl = classLoaderMgr.obtainResourceClassLoader(resource, parentContainer, additionalJars);
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.
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-2330
Temporarily adding the keyword "SubBug" so we can be sure we have accounted for all the bugs.
new = Tracking + FutureFeature + SubBug
making sure we're not missing any bugs in rhq_triage
The code seems the same but the issue has not come up in over 4 years, it seems. So, closing.