META-INF/extensions.idx loaded from application classpath instead of plugin classpath when using ClassLoadingStrategy.APD

23 views
Skip to first unread message

Allain Legacy

unread,
Oct 26, 2022, 4:42:01 PM10/26/22
to pf4j
Hi,
I am trying to use ClassLoadingStrategy.APD (parent first) but am getting a "No extensions found" error when trying to load the plugins.    

The issue appears to be with how the "META-INF/extensions.idx" file is loaded when using the APD loading strategy.   It appears to be finding an empty extensions.idx file in the parent context rather than the valid one in the plugin context.  

These are the debug/trace logs for the relevant section.  It first appears to find an extensions.idx file within the pf4j-spring-0.7.0.jar file which is empty, and then later it finds another META-INF/extensions.idx in the application context.  

I suspect these are the same file.   I am not sure why the pf4j-spring jar has an extensions.idx file itself since it is not a plugin.   Is there a way to exclude this file or to force the loader to look at the plugin context for this one file rather than the application context?


 [plugin=wsaf-plugin-sample, newState=STARTED, oldState=RESOLVED]' to 'org.pf4j.DefaultExtensionFinder@4f8969b0'
2022-10-26 16:17:52.601 DEBUG 60535 --- [           main] org.pf4j.LegacyExtensionFinder           : Reading extensions storages from classpath
2022-10-26 16:17:52.602 DEBUG 60535 --- [           main] org.pf4j.LegacyExtensionFinder           : Read 'file:/Users/foo/pf4j-test-app/build/libs/pf4j-test-app.jar!/BOOT-INF/lib/pf4j-spring-0.7.0.jar!/META-INF/extensions.idx'
2022-10-26 16:17:52.602 DEBUG 60535 --- [           main] org.pf4j.AbstractExtensionFinder         : No extensions found
2022-10-26 16:17:52.602 DEBUG 60535 --- [           main] org.pf4j.LegacyExtensionFinder           : Reading extensions storages from plugins
2022-10-26 16:17:52.602 DEBUG 60535 --- [           main] org.pf4j.LegacyExtensionFinder           : Reading extensions storage from plugin 'pf4j-test-plugin'
2022-10-26 16:17:52.602 DEBUG 60535 --- [           main] org.pf4j.LegacyExtensionFinder           : Read 'META-INF/extensions.idx'
2022-10-26 16:17:52.602 TRACE 60535 --- [           main] org.pf4j.PluginClassLoader               : Received request to load resource 'META-INF/extensions.idx'
2022-10-26 16:17:52.602 TRACE 60535 --- [           main] org.pf4j.PluginClassLoader               : Found resource 'META-INF/extensions.idx' in APPLICATION classpath
2022-10-26 16:17:52.603 DEBUG 60535 --- [           main] org.pf4j.AbstractExtensionFinder         : No extensions found


Reply all
Reply to author
Forward
0 new messages