mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-16 13:32:24 +00:00
When this happens to classloaders (that is, when the master exports its classloader to a remote machine, which re-exports this remote classloader to the master to make a callback), we end up creating a RemoteClassLoader on the master to load a duplicate copy. A duplicate copy happens when we try to load a class from plugins, because ImportedClassLoaderTable creates new RemoteClassLoader with the 'getClass().getClassLoader()' as the parent, which doesn't see the plugin classes. To fix this problem, RemoteClassLoader is modified to detect the situation where a round-trip re-exporting is about to happen. Upon detecting this, it will arrange things in such a way that the other side will get the original ClassLoader instance back, instead of doubly-proxied RemoteClassLoader. This fixes the problem discussed in http://www.nabble.com/Help-Kohsuke%21-m2-project-type-and-cobertura-tf4829718.html and http://www.nabble.com/MavenReporter-throws-Serialization-Exception-for-ProjectActions-when-writing-to-build.xml-tf4784290.html#a13687067 git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@5997 71c3de6d-444a-0410-be80-ed276b4c234a