为了账号安全,请及时绑定邮箱和手机立即绑定

测试一直报错

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 回答

同学好,关键看这句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 回复 有任何疑惑可以回复我~

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

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

测试一直报错

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信