Skip to content

Commit

Permalink
DUBBO-616 javassist class loader 问题
Browse files Browse the repository at this point in the history
  • Loading branch information
kimi committed Nov 22, 2012
1 parent 2fb8bd5 commit 5a98aa2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import javassist.LoaderClassPath;
import javassist.NotFoundException;

import com.alibaba.dubbo.common.utils.ClassHelper;
import com.alibaba.dubbo.common.utils.ReflectUtils;

/**
Expand All @@ -59,7 +58,7 @@ public static interface DC{} // dynamic class tag interface.

public static ClassGenerator newInstance()
{
return new ClassGenerator(getClassPool(ClassHelper.getCallerClassLoader(ClassGenerator.class)));
return new ClassGenerator(getClassPool(Thread.currentThread().getContextClassLoader()));
}

public static ClassGenerator newInstance(ClassLoader loader)
Expand Down Expand Up @@ -335,7 +334,7 @@ public Class<?> toClass()
}
}
}
return mCtc.toClass(ClassHelper.getCallerClassLoader(getClass()), null);
return mCtc.toClass();
}
catch(RuntimeException e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ private static Wrapper makeWrapper(Class<?> c)
throw new IllegalArgumentException("Can not create wrapper for primitive type: " + c);

String name = c.getName();
ClassLoader cl = ClassHelper.getCallerClassLoader(Wrapper.class);
ClassLoader cl = ClassHelper.getClassLoader(c);

StringBuilder c1 = new StringBuilder("public void setPropertyValue(Object o, String n, Object v){ ");
StringBuilder c2 = new StringBuilder("public Object getPropertyValue(Object o, String n){ ");
Expand Down

0 comments on commit 5a98aa2

Please sign in to comment.