Solution to bean class conflicts with existing exception after modifying package name in IDEA

Solution: Execute the clean command of Lifecycle in Maven.

Related exception: Renamed the original package name "controller" to "app" and restarted the service, but the startup failed. Some of the exception information printed out by the console is as follows:

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

Guess you like

Origin blog.csdn.net/shinyolive/article/details/113821127