Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RemoteClassLoader is not honoring the classloader that's passed to the Channel contructor #148

Merged
merged 1 commit into from
Jun 3, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions remoting/src/main/java/hudson/remoting/Channel.java
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,11 @@ public class Channel implements VirtualChannel, IChannel {

/*package*/ final ExecutorService pipeWriter;

/**
* ClassLaoder that remote classloaders should use as the basis.
*/
/*package*/ final ClassLoader baseClassLoader;

/**
* Communication mode.
* @since 1.161
Expand Down Expand Up @@ -356,6 +361,7 @@ public Channel(String name, ExecutorService exec, Mode mode, InputStream is, Out

if (base==null)
base = getClass().getClassLoader();
this.baseClassLoader = base;

if(export(this,false)!=1)
throw new AssertionError(); // export number 1 is reserved for the channel itself
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public synchronized ClassLoader get(IClassLoader classLoaderProxy) {
if(r==null) {
// we need to be able to use the same hudson.remoting classes, hence delegate
// to this class loader.
r = RemoteClassLoader.create(getClass().getClassLoader(),classLoaderProxy);
r = RemoteClassLoader.create(channel.baseClassLoader,classLoaderProxy);
classLoaders.put(classLoaderProxy,r);
}
return r;
Expand Down