
SpringBoot Consider defining a bean of type 'com.xxx.xxx.dao.UserDao' in your configuratio
SpringBoot 遇到的问题
遇到错误提示 required a bean of type 'com.xxx.xxx.dao.UserDao' that could not be found. 但是查看使用UserDao的UserController已经使用了@AutoWired,并且UserDao也加了@Repository注解。
required a bean of type 'com.xxx.xxx.dao.UserDao' that could not be found. Action:Consider defining a bean of type 'com.xxx.xxx.dao.UserDao' in your configuration. 引起问题的原因
后来发现是因为UserDao使用的UserEntity类没有添加@Entity注解
解决办法对UserEntity类添加@Entity注解
Append查看网络资料发现引起这个错误的原因可能各不相同,还是得多查看熟悉自己的代码,遇到这个错误很多是因为改别人的项目时不熟悉代码遇到的
👁️ 阅读量:0
© 版权声明:本文《SpringBoot Consider defining a bean of type 'com.xxx.xxx.dao.UserDao' in your configuratio》内容均为本站精心整理或网友自愿分享,如需转载请注明原文出处:https://www.zastudy.cn/wen/1686552339a289889.html。