Extension error when creating plugin

171 views
Skip to first unread message

nony bright

unread,
Mar 31, 2017, 3:08:17 PM3/31/17
to pf4j
Hello please i need some help, I'm new to plugin developmentand classloaders. i've been able grab the concept of classloaders but i need a framework to help me manage plugins better and pf4j seem to be what i need for my project but I've been getting some errors while trying to set it up. I just need someone to help me out. I'm really needy! :-(

i tried my hands on the creating a plugin, it seem to have loaded properly but keeps giving me an error because META-INF/extensions.idx is not created when i compile and run the program. Do i need to create the file by myself? I really need help.

here is the error i get:

2017-03-31 18:51:45,128 INFO ro.fortsoft.pf4j.DefaultPluginStatusProvider - Enabled plugins: []
2017-03-31 18:51:45,128 INFO ro.fortsoft.pf4j.DefaultPluginStatusProvider - Disabled plugins: []
2017-03-31 18:51:45,143 INFO ro.fortsoft.pf4j.DefaultPluginManager - PF4J version 1.2.0 in 'development' mode
2017-03-31 18:51:45,143 DEBUG ro.fortsoft.pf4j.AbstractPluginManager - Lookup plugins in 'C:\plugins'
2017-03-31 18:51:45,150 DEBUG ro.fortsoft.pf4j.AbstractPluginManager - Found 1 possible plugins: [C:\plugins\plugin1]
2017-03-31 18:51:45,150 DEBUG ro.fortsoft.pf4j.AbstractPluginManager - Find plugin descriptor 'C:\plugins\plugin1'
2017-03-31 18:51:45,151 DEBUG ro.fortsoft.pf4j.PropertiesPluginDescriptorFinder - Lookup plugin descriptor in 'C:\plugins\plugin1\plugin.properties'
2017-03-31 18:51:45,157 DEBUG ro.fortsoft.pf4j.AbstractPluginManager - Descriptor PluginDescriptor [pluginId=welcome-plugin, pluginClass=nony.WelcomePlugin, version=0.0.1, provider=nony, dependencies=[]]
2017-03-31 18:51:45,157 DEBUG ro.fortsoft.pf4j.AbstractPluginManager - Class 'nony.WelcomePlugin' for plugin 'C:\plugins\plugin1'
2017-03-31 18:51:45,157 DEBUG ro.fortsoft.pf4j.AbstractPluginManager - Loading plugin 'C:\plugins\plugin1'
2017-03-31 18:51:45,158 DEBUG ro.fortsoft.pf4j.AbstractPluginManager - Loaded plugin 'C:\plugins\plugin1' with class loader 'ro.fortsoft.pf4j.PluginClassLoader@4d76f3f8'
2017-03-31 18:51:45,158 DEBUG ro.fortsoft.pf4j.AbstractPluginManager - Creating wrapper for plugin 'C:\plugins\plugin1'
2017-03-31 18:51:45,159 DEBUG ro.fortsoft.pf4j.AbstractPluginManager - Created wrapper 'PluginWrapper [descriptor=PluginDescriptor [pluginId=welcome-plugin, pluginClass=nony.WelcomePlugin, version=0.0.1, provider=nony, dependencies=[]], pluginPath=C:\plugins\plugin1]' for plugin 'C:\plugins\plugin1'
2017-03-31 18:51:45,159 DEBUG ro.fortsoft.pf4j.DependencyResolver - Graph:
   welcome
-plugin -> []
2017-03-31 18:51:45,159 DEBUG ro.fortsoft.pf4j.DependencyResolver - Plugins order: [welcome-plugin]
2017-03-31 18:51:45,160 INFO ro.fortsoft.pf4j.AbstractPluginManager - Plugin 'welcome-plugin' resolved
2017-03-31 18:51:45,160 INFO ro.fortsoft.pf4j.AbstractPluginManager - Start plugin 'welcome-plugin:0.0.1'
2017-03-31 18:51:45,160 DEBUG ro.fortsoft.pf4j.DefaultExtensionFactory - Create instance for plugin 'nony.WelcomePlugin'
2017-03-31 18:51:45,161 DEBUG ro.fortsoft.pf4j.AbstractPluginManager - Fire 'PluginStateEvent [plugin=welcome-plugin, newState=STARTED, oldState=CREATED]' to 'ro.fortsoft.pf4j.DefaultExtensionFinder@b1a58a3'
2017-03-31 18:51:45,162 DEBUG ro.fortsoft.pf4j.AbstractExtensionFinder - Finding extensions of extension point 'nony.Greeting'
2017-03-31 18:51:45,162 DEBUG ro.fortsoft.pf4j.LegacyExtensionFinder - Reading extensions storages from classpath
2017-03-31 18:51:45,162 DEBUG ro.fortsoft.pf4j.AbstractExtensionFinder - No extensions found
2017-03-31 18:51:45,162 DEBUG ro.fortsoft.pf4j.LegacyExtensionFinder - Reading extensions storages from plugins
2017-03-31 18:51:45,162 DEBUG ro.fortsoft.pf4j.LegacyExtensionFinder - Reading extensions storage from plugin 'welcome-plugin'
2017-03-31 18:51:45,162 DEBUG ro.fortsoft.pf4j.LegacyExtensionFinder - Cannot find 'META-INF/extensions.idx'
2017-03-31 18:51:45,162 DEBUG ro.fortsoft.pf4j.AbstractExtensionFinder - No extensions found
2017-03-31 18:51:45,163 DEBUG ro.fortsoft.pf4j.AbstractExtensionFinder - Finding extensions of extension point 'nony.Greeting' for plugin 'null'
2017-03-31 18:51:45,163 DEBUG ro.fortsoft.pf4j.AbstractExtensionFinder - Finding extensions of extension point 'nony.Greeting' for plugin 'welcome-plugin'
2017-03-31 18:51:45,163 DEBUG ro.fortsoft.pf4j.AbstractExtensionFinder - Found 0 extensions for extension point 'nony.Greeting'







Decebal Suiu

unread,
Mar 31, 2017, 4:25:23 PM3/31/17
to pf4j
The extensions.idx file is created automatically. Please read [1] and [2].

kofi.j...@gmail.com

unread,
Mar 31, 2017, 6:58:45 PM3/31/17
to pf4j
Thanx a lot for your reply. I've tried setting annotation on eclipse but still having the same issue.I will try other possible options.

Decebal Suiu

unread,
Apr 1, 2017, 2:03:17 AM4/1/17
to pf4j, kofi.j...@gmail.com
First of all check to see if you have extensions.idx in "your_plugin/target/classes/META-INF" folder. If the file doesn't exist, that means that the annotation processor from Eclipse (I suppose that it's your IDE) doesn't work.
If extensions.idx exists then you should read [1] because I don't know how you run the application.
Also, I recommend you to take a look at demo (maybe to try to run the demo app that comes with pf4j).

kofi.j...@gmail.com

unread,
Apr 6, 2017, 5:47:22 PM4/6/17
to pf4j, kofi.j...@gmail.com
Sorry for the late reply. I still can't figure out what i have done wrong. The META-INF folder after building the project contains the MANIFEST.MF file but not the extension.idx file. I have also done the annotation settings on the project in eclipse (currently using the pf4j demo project) but i still get the same message. Also tried adding mavin annotation processor to the maven-compiler-plugin configuration in the parent pom.xml file but it causes an error. I will try to rectify the error and see if it will work.
Reply all
Reply to author
Forward
0 new messages