org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/classes/springContext.xml]; nested exception is java.lang.IllegalStateException: Annotation-specified bean name 'cardController' for bean class [com.qdzq.wlpt.controller.api.CardController] conflicts with existing, non-compatible bean definition of same name and class [com.qdzq.wlpt.controller.admin.CardController]不同包下的文件不是可以重名吗?
2 回答
繁星淼淼
TA贡献1775条经验 获得超11个赞
你有2个CardController,自动注入后bean的id就冲突了,如果2个都想要,在spring文件里面配置2个bean,设置成不同的id,就不会冲突了,spring默认bean的id就是类名首字母小写
添加回答
举报
0/150
提交
取消