0
点赞
收藏
分享

微信扫一扫

java日常解决bug

前行的跋涉者 2022-04-15 阅读 98
java-ee

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.SpringbootMybatisPulsDemo3ApplicationTests': Unsatisfied dependency expressed through field 'userDao'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.dao.UserDao' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

原因是:没有扫描到mapper包

在主启动类上添加扫描mapper包的注解。

@MapperScan("com.dao")

即可

举报

相关推荐

0 条评论