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.
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. keyword: new = Tracking + FutureFeature + SubBug
making sure we're not missing any bugs in rhq_triage
Triaged 17-Nov
The code seems the same but the issue has not come up in over 4 years, it seems. So, closing.