测试一直报错

来源:3-6 dao层开发

豆小豆1314

2018-03-07 16:59

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sessionFactoryConfiguration': Unsatisfied dependency expressed through field 'dataSource'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.tomcat.jdbc.pool.DataSource' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true), @org.springframework.beans.factory.annotation.Qualifier(value=dataSource)}

写回答 关注

2回答

  • 翔仔
    2018-03-07 17:35:55

    同学好,关键看这句Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.tomcat.jdbc.pool.DataSource' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true), @org.springframework.beans.factory.annotation.Qualifier(value=dataSource)}

    没有设置相应的datasource bean注入  是不是漏掉@Bean标签了


  • 陈锋同学0
    2018-04-05 17:33:00

    https://img1.mukewang.com/5ac5ed40000193af19241110.jpg请教一下老师这是什么原因?

SpringBoot+MyBatis搭建迷你小程序

SpringBoot+MyBatis搭建小程序后台

91657 学习 · 622 问题

查看课程

相似问题