首页 > 其他分享 >Failed to process import candidates for configuration class [springfox.documentation.swagger2.config

Failed to process import candidates for configuration class [springfox.documentation.swagger2.config

时间:2023-04-17 18:12:38浏览次数:41  
标签:configuration process bean candidates import springfox class

 

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [springfox.documentation.swagger2.configuration.Swagger2DocumentationConfiguration]; nested exception is java.lang.IllegalArgumentException: Unresolvable class definition for class [springfox.documentation.spring.web.OnServletBasedWebApplication]

 

解决:

https://stackoverflow.com/questions/72870322/failed-to-process-import-candidates-for-configuration-class-springfox-documenta

 

nested exception is org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name

 

根据bean名称在ide中查找,找到这两个重名的类,可以看到由于这两个类使用@Service标注,此时如果不使用命名,那么Spring会在扫描时,将类名首字母小写作为key,放到一个全局Map中维护。此时,会出现两个键相同的Service,由于Spring不使用覆盖的方式处理具有相同键的不同全类名,所以扫描时提示冲突。

 

https://www.cnblogs.com/zjfjava/p/11654606.html

  https://copyprogramming.com/howto/annotation-specified-bean-name-conflicts-with-existing-non-compatible-bean-def 

标签:configuration,process,bean,candidates,import,springfox,class
From: https://www.cnblogs.com/parkdifferent/p/17326693.html

相关文章