HI, Appreciate any help here.
I am using pf4j within spring boot and am able to load plugins/extensions and invoke them when running the app from command line. From within eclipse though it doesn't work. pf4j won't create the extension object though it finds the plugin and extension classes. Stepping through the pf4j code it fails in AbstractExtensionFinder where the code checks if the created extension object can be cast to the extension interface. That check fails due to different class loaders. Here is the msg from console.
Extensions added by plugin 'simple-hello-plugin':
com.curisprofound.plugins.simple.SimplePlugin$SimpleIdentityPlugin
2020-06-13 23:29:07.080 INFO 248 --- [ restartedMain] com.opencodez.RatingExtensions : Extensions instances added by plugin 'simple-hello-plugin' for extension point 'com.curisprofound.plugins.PluginInterface':
2020-06-13 23:29:07.081 ERROR 248 --- [ restartedMain] org.pf4j.AbstractExtensionFinder : Different class loaders: 'org.pf4j.PluginClassLoader@36903a10' (E) and 'org.springframework.boot.devtools.restart.classloader.RestartClassLoader@3a6dacb0' (EP)
I understand it is because of different class loaders for interface and extension object, but is there a resolution for this so I can debug my application within Eclipse. Do I have control over which classloader loads the interface class. Also, is this working in command line only by luck or will always work and it is an issue ONLY within Eclipse.
thanks