Browse Source

fix for #53

pull/56/head
Decebal Suiu 10 years ago
parent
commit
302ec57f15
  1. 6
      pf4j/src/main/java/ro/fortsoft/pf4j/PluginClassLoader.java

6
pf4j/src/main/java/ro/fortsoft/pf4j/PluginClassLoader.java

@ -55,6 +55,7 @@ public class PluginClassLoader extends URLClassLoader {
*/
@Override
public Class<?> loadClass(String className) throws ClassNotFoundException {
synchronized (getClassLoadingLock(className)) {
log.debug("Received request to load class '{}'", className);
// if the class it's a part of the plugin engine use parent class loader
if (className.startsWith(PLUGIN_PACKAGE_PREFIX)) {
@ -64,8 +65,8 @@ public class PluginClassLoader extends URLClassLoader {
} catch (ClassNotFoundException e) {
// try next step
// TODO if I uncomment below lines (the correct approach) I received ClassNotFoundException for demo (ro.fortsoft.pf4j.demo)
// log.error(e.getMessage(), e);
// throw e;
// log.error(e.getMessage(), e);
// throw e;
}
}
@ -102,6 +103,7 @@ public class PluginClassLoader extends URLClassLoader {
// use the standard URLClassLoader (which follows normal parent delegation)
return super.loadClass(className);
}
}
/**
* Load the named resource from this plugin. This implementation checks the plugin's classpath first

Loading…
Cancel
Save