原文:spring-boot 启动时候 出现异常:The bean 'xxx' could not be injected as a 'xx.xxxx' because it is a JDK dynami

Resource private UmsUserMapper userMapper 如上代码会报错,这是因为程序中有一个UserMapper,所以当命名为userMapper会首先查找UserMapper这个类而不是UmsUserMapper这个类,改成umsUserMapper程序正常。注入时的变量命名很重要 ...

2020-10-22 14:12 0 1439 推荐指数:

查看详情

Field XXX in XXXX required a bean of type XXXX that could not be found

这个报错的意思是:没有找到相应的bean出现这个情况我遇到了两种: 1.spring没有扫描到相应的bean。 原因是springboot项目启动,只有@SpringBootApplication 所在的包被被扫描,如果有其他需要扫描的包,需要显式写明 ...

Sat Oct 27 18:53:00 CST 2018 0 10210
spring-boot:run启动时,指定spring.profiles.active

Maven启动指定Profile通过-P,如mvn spring-boot:run -Ptest,但这是Maven的Profile。 如果要指定spring-bootspring.profiles.active,则必须使用mvn spring-boot:run -Drun.profiles ...

Mon Oct 23 17:10:00 CST 2017 0 12095
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM