提交 7e16c976 authored 作者: Thomas Mueller's avatar Thomas Mueller

OSGi test code (need to verify)

上级 60b2f82c
......@@ -406,6 +406,18 @@ public class Utils {
throw DbException.get(ErrorCode.ACCESS_DENIED_TO_CLASS_1, className);
}
}
// the following code might be better for OSGi (need to verify):
/*
try {
return Utils.class.getClassLoader().loadClass(className);
} catch (Throwable e) {
try {
return Thread.currentThread().getContextClassLoader().loadClass(className);
} catch (Throwable e2) {
DbException.get(ErrorCode.CLASS_NOT_FOUND_1, e, className);
}
}
*/
try {
return Class.forName(className);
} catch (ClassNotFoundException e) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论