0
点赞
收藏
分享

微信扫一扫

Error creating bean with name ‘com.yangjunbo.JPADemo.UserRepositoryTest‘


异常信息:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘com.yangjunbo.JPADemo.UserRepositoryTest’: Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘com.yangjunbo.JPADemo.repository.UserRepository’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@javax.annotation.Resource(shareable=true, lookup=, name=, description=, authenticationType=CONTAINER, type=class java.lang.Object, mappedName=)}

Error creating bean with name ‘com.yangjunbo.JPADemo.UserRepositoryTest‘_异常信息

问题描述:

今天在使用springboot程序进行测试的时候,运行测试方法,报了这个异常。

解决办法

经过检查,发现是因为测试类上少加了**@SpringBootTest**注解导致

Error creating bean with name ‘com.yangjunbo.JPADemo.UserRepositoryTest‘_spring_02


举报

相关推荐

0 条评论