`

Unsatisfied dependency expressed through bean property 'dataSource'

阅读更多
用AbstractTransactionalDataSourceSpringContextTests(当时只想单纯的试下,没有配置dateSouce)
报的错:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name

'com.MM2': Unsatisfied dependency expressed through bean property 'dataSource': Set this property value

or disable dependency checking for this bean.


解决办法:在测试类的构造方法 setDependencyCheck(false);//不去检查


折腾了我半天啊
用AbstractDependencyInjectionSpringContextTests没有这些麻烦,但是他不能数据回滚
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics