IDEA中修改package名称后出现bean class conflicts with existing异常解决办法

解决办法: 执行Maven中Lifecycle的clean命令。

相关异常: 将原package名称“controller”重命名为“app”,重新启动服务,启动失败。控制台打印出的部分异常信息如下:

2021-02-15 17:52:23.937  WARN 19900 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.xxx.xxxx.test.XxxApplication]; nested exception is org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'xxXController' for bean class [com.xxx.xxxx.test.controller.AxxxxController] conflicts with existing, non-compatible bean definition of same name and class [com.xxx.xxxx.test.app.AxxxxController]
2021-02-15 17:52:23.956 ERROR 19900 --- [           main] o.s.boot.SpringApplication               : Application run failed

猜你喜欢

转载自blog.csdn.net/shinyolive/article/details/113821127
今日推荐