這已經被保持引用已實例化的MBean上的ClassLoader workarounded:
/** the classLoader to use for future usages */
protected final ClassLoader instanciatingClassLoader;
/** Default constructor */
public MyMonitoringBean() {
// Keep in reference the classLoader used to instanciate this object
this.instanciatingClassLoader = Thread.currentThread().getContextClassLoader();
}
protected ClassLoader getClassLoader() {
return instanciatingClassLoader;
}
因爲到此MBean調用在一個線程與爲ClassLoader的不是Web應用程序類加載器執行它並不能解決這個票,但對類加載器如特定電話:
getClassLoader().loadClass(className)
可以通過直接在Web應用程序的類加載器
來源
2013-08-02 10:23:42
bla