Rmi的辅助接口使用原接口相同的ClassLoader

git-svn-id: http://code.alibabatech.com/svn/dubbo/trunk@225 1a56cb94-b969-4eaa-88fa-be21384802f2
This commit is contained in:
ding.lid 2011-11-10 03:22:33 +00:00
parent dc3e408c7c
commit c0cda8e25e
1 changed files with 2 additions and 2 deletions

View File

@ -199,9 +199,9 @@ public class RmiProtocol extends AbstractProtocol {
try {
String remoteType = type.getName() + "$Remote";
try {
return (Class<T>) Class.forName(remoteType, true, Thread.currentThread().getContextClassLoader());
return (Class<T>) Class.forName(remoteType, true, type.getClassLoader());
} catch (ClassNotFoundException e) {
ClassPool pool = ClassGenerator.getClassPool(Thread.currentThread().getContextClassLoader());
ClassPool pool = ClassGenerator.getClassPool(type.getClassLoader());
CtClass ctClass = pool.makeInterface(remoteType);
ctClass.addInterface(pool.getCtClass(type.getName()));
ctClass.addInterface(pool.getCtClass(Remote.class.getName()));