gpt4 book ai didi

java - 重构Intellij后出现ConflictingBeanDefinitionException

转载 作者:搜寻专家 更新时间:2023-11-01 03:50:33 24 4
gpt4 key购买 nike

我遇到一个 ConflictingBeanDefiitionException 说 org.company.app.core.controller.web.EquipmentController 与 org.company.app.core.controller.EquipmentController 冲突。唯一的问题是没有 org.company.app.core.controller.EquipmentController。它曾经在那里,我把它移到了包 org.company.app.core.controller.web 中。

我不明白为什么会这样。这是一个奇怪的 Intellij 问题还是什么?

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

最佳答案

mvn clean package

为我工作。它尝试清除 Maven 在其旧构建期间生成的文件和目录。

关于java - 重构Intellij后出现ConflictingBeanDefinitionException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29808818/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com