Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘XXXController’: Unsatisfied dependency expressed through field ‘pp’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘XXXService’: Unsatisfied dependency expressed through field ‘userTestDao’; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘com.example.dao.primary.XXXDao’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
先说下我的项目环境,springboot+mybatis+springmvc 其中数据源使用配置类的方式写的,想写一个简单的查询测试数据源配置是否正确
启动时报错的信息如上所示,昨天下午弄了一下午,在网上搜无非就是以下几种情况:
1.可能是因为dao层的接口没有使用@mapper注解或者@repository将这个接