Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ConflictingBeanDefinitionException after refactoring Intellij

I am encountering a ConflictingBeanDefiitionException saying org.company.app.core.controller.web.EquipmentController conflicts with org.company.app.core.controller.EquipmentController. The only problem is there is no org.company.app.core.controller.EquipmentController. It used to be there, I moved it to the package org.company.app.core.controller.web.

I don't understand why this is happening. Is this a weird Intellij thing or what?

Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'equipmentController' for bean class [org.company.app.core.controller.web.EquipmentController] conflicts with existing, non-compatible bean definition of same name and class [org.company.app.core.controller.EquipmentController]
    at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.checkCandidate(ClassPathBeanDefinitionScanner.java:320)
    at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:259)
    at org.springframework.context.annotation.ComponentScanAnnotationParser.parse(ComponentScanAnnotationParser.java:140)
    at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:262)
    at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:226)
    at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:480)
    ... 59 more
like image 712
greyfox Avatar asked Nov 01 '22 06:11

greyfox


1 Answers

mvn clean package

Worked for me . It attempts to clean the files and directories generated by Maven during its old build.

like image 115
sheetal Avatar answered Nov 13 '22 14:11

sheetal