pf4j / pf4j-spring

Plugin Framework for Spring (PF4J - Spring Framework integration)
Apache License 2.0
346 stars 105 forks source link

An error is reported when running a plugin in a Spring Boot project and introducing additional Spring dependencies into the plugin #86

Open Aboudkingto opened 1 week ago

Aboudkingto commented 1 week ago

I'm using a SpringBoot main project, introducing Spring Security dependencies into my plugin project, I package it into the jar when packing, and use the plugin in the main project, but running SpringBoot gives an error, the following is the error content. java.lang.LinkageError: loader constraint violation for class org.stardye.plugins.devise.security.SercurityPlugin: when selecting overriding method 'org.springframework.context.ApplicationContext org.stardye.plugins.devise.security.SercurityPlugin.createApplicationContext()' the class loader org.pf4j.PluginClassLoader @73844119 of the selected method's type org.stardye.plugins.devise.security.SercurityPlugin, and the class loader 'app' for its super type org.pf4j.spring.SpringPlugin have different Class objects for the type org.springframework.context.ApplicationContext used in the signature (org.stardye.plugins.devise.security.SercurityPlugin is in unnamed module of loader org.pf4j.PluginClassLoader @73844119, parent loader 'app'; org.pf4j.spring.SpringPlugin is in unnamed module of loader 'app')