Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fails to recognize external extensions #64
I have an issue with external plugins.
I took the demo project and extended it with one more plugin that is loaded from a .zip file. But when I did this I always get this error:
DEBUG ro.fortsoft.pf4j.DefaultExtensionFinder - 'test.pf4j.main.Greeting' is not assignable from extension point 'test.pf4j.plugins.CheersPlugin$WelcomeGreeting'
The exact same code works if I just move it into the same jar file as the main program.
Identified the issue.
Since the .zip file for the external plugin as default includes the .jar file containing the interface this is used rather then the original one. This leads to that there are two different interface objects in two different classloaders and hence the isAssignableFrom call fails.
Solution: make sure that the plugins .zip file doesn't contain any unwanted libs.
Great. I have met many situations like this. The log of pf4j is very detailed on debug and you can see where is the problem (you can see what classes are loaded by each plugin class loader).