spring boot No qualifying bean of type

Eran-promise 2017-12-02 11:43:54
这是报错:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.example.demo.UserRepositoryTests': Unsatisfied dependency expressed through field 'userIface'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.example.demo.domain.UserRepository' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
这是我的代码:






...全文
1588 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
短腿小鲁蛋 2019-08-01
  • 打赏
  • 举报
回复
怎么结局的大哥
pois 2017-12-04
  • 打赏
  • 举报
回复
一般是repository语法错误导致注入失败
Sunyiban 2017-12-04
  • 打赏
  • 举报
回复
少加载了spring配置文件
Royal_lr 2017-12-04
  • 打赏
  • 举报
回复
你这环境有问题吧,都没加载spring的配置文件,依赖注入都失败了

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧