org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [mvc-dispatcher.xml]; nested exception is org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'fileController' for bean class [com.sw.controller.FileController] conflicts with existing, non-compatible bean definition of same name and class [com.cm.controller.FileController]

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:414)

报名从com.cm改成了com.sw

,所以并不存在`

com.cm.controller.FileController

回答

1、 bean 重复,删掉一个就好了。

com.sw.controller.FileController

com.cm.controller.FileController

2、或者加个别名

@RestController(“xxxController”)

@RequestMapping(“common”)

public class CommonController {

Logo

一站式 AI 云服务平台

更多推荐