原文:non-compatible bean definition of same name and class

在整合struts . . spring . . 开发中,使用了注解和struts convention来实现零配置管理。spring也使用注解annotation方式。现在的问题是:我在连个个不同package中有两个相同名称的类,只是类所在的目录不同。例如在 com.idearsoft.idear.module.SystemMaintain.action下有个HomeAction.java,在 ...

2017-03-21 15:16 0 10601 推荐指数:

查看详情

异常解决:non-compatible bean definition of same name and class【com.xxx.xxx.XXX】

昨天同事遇到这样一个问题,意思是spring找到 有相同的实现类名在不同的package目录下。 跟踪他的项目代码并未发现问题。 重新给他的maven项目进行maven install一下。 查看打好的war包,发现里面确实存在相同的实现类名的class文件。 原因:他之前 ...

Wed Jul 03 00:16:00 CST 2019 0 600
bean名称相同冲突Annotation-specified bean name 'xx' for bean class [xxx] conflicts with existing, non-compatible bean definition of same name and class[xxx]

工程中引入其他工程的包,由于两个工程中有重名的两个bean,导致在启动时提示如下错误: 根据bean名称在ide中查找,找到这两个重名的类,可以看到由于这两个类使用@Service标注,此时如果不使用命名,那么Spring会在扫描时,将类名首字母小写作为key,放到一个全局Map中维护。此时 ...

Fri Oct 11 23:40:00 CST 2019 0 5366
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM