Plugin loading fails for zip file but works for JAR file

22 views
Skip to first unread message

marge...@gmail.com

unread,
Jun 15, 2020, 11:51:34 PM6/15/20
to pf4j
I am missing something simple here (I hope), but  my test app (pf4j with springboot) works fine with the plugin provided as a JAR file in the plugins directory. If I replace that with the zip file of the plugin, the app fails with a NoClassFoundException. The zip file seems to have been expanded fine in the plugins directory and I see the appropriate class files for plugin and extension. 

Below is the relevant stack trace. I am running on Windows with Java 1.8.  thanks.

----------------------------------------------------
2020-06-15 22:39:07.413  INFO 4112 --- [           main] org.pf4j.DefaultPluginStatusProvider     : Enabled plugins: []
2020-06-15 22:39:07.414  INFO 4112 --- [           main] org.pf4j.DefaultPluginStatusProvider     : Disabled plugins: []
2020-06-15 22:39:07.432  INFO 4112 --- [           main] org.pf4j.DefaultPluginManager            : PF4J version 2.3.0 in 'development' mode
2020-06-15 22:39:07.529  INFO 4112 --- [           main] org.pf4j.util.FileUtils                  : Expanded plugin zip 'test-plugin-simple-1.0-SNAPSHOT.zip' in 'test-plugin-simple-1.0-SNAPSHOT'
2020-06-15 22:39:07.562  INFO 4112 --- [           main] org.pf4j.AbstractPluginManager           : Plugin 'simple-iden...@0.0.1' resolved
2020-06-15 22:39:07.565  INFO 4112 --- [           main] org.pf4j.AbstractPluginManager           : Start plugin 'simple-iden...@0.0.1'
2020-06-15 22:39:07.586 ERROR 4112 --- [           main] org.pf4j.DefaultExtensionFactory         : com.curisprofound.plugins.simple.SimplePlugin

java.lang.ClassNotFoundException: com.curisprofound.plugins.simple.SimplePlugin
        at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[na:1.8.0_251]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[na:1.8.0_251]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[na:1.8.0_251]
        at org.pf4j.PluginClassLoader.loadClass(PluginClassLoader.java:126) ~[pf4j-2.3.0.jar!/:2.3.0]
        at org.pf4j.DefaultPluginFactory.create(DefaultPluginFactory.java:46) ~[pf4j-2.3.0.jar!/:2.3.0]
        at org.pf4j.PluginWrapper.getPlugin(PluginWrapper.java:78) [pf4j-2.3.0.jar!/:2.3.0]
        at org.pf4j.AbstractPluginManager.startPlugins(AbstractPluginManager.java:326) [pf4j-2.3.0.jar!/:2.3.0]
        at com.opencodez.RatingExtensions.<init>(RatingExtensions.java:27) [classes!/:0.0.1-SNAPSHOT]
        at com.opencodez.AppConfig.getExtensions(AppConfig.java:36) [classes!/:0.0.1-SNAPSHOT]
        at com.opencodez.AppConfig$$EnhancerBySpringCGLIB$$d8e95304.CGLIB$getExtensions$1(<generated>) [classes!/:0.0.1-SNAPSHOT]
        at com.opencodez.AppConfig$$EnhancerBySpringCGLIB$$d8e95304$$FastClassBySpringCGLIB$$2e5a9d8.invoke(<generated>) [classes!/:0.0.1-SNAPSHOT]
Reply all
Reply to author
Forward
0 new messages