原文: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