在@Test 中測(cè)試方法是報(bào)錯(cuò)
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.ztes.demo.dao.AreaDaoTest': Unsatisfied dependency expressed through field 'areaDao'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.ztes.demo.dao.AreaDao' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}?
測(cè)試報(bào)這樣的錯(cuò)什么原因????請(qǐng)高手幫忙回答下。謝謝?。?!
2018-03-06
同學(xué)好,請(qǐng)確保你的package設(shè)置正確,com.ztes.demo.dao.AreaDao,我看截圖里是com.imooc.demo.dao.AreaDao...
2020-07-23
-_-||-_-||-_-||-_-||-_-||-_-||-_-||-_-||加了@mapper 或者@repostory也不行,加了@Mapper public interface AreaDao{ }也不行? 就是報(bào)錯(cuò)。。
2020-03-02
我也是,加了@mapper 或者@repostory也不行
2019-08-23
mapperscan的包路徑改到.demo就不報(bào)錯(cuò)了
2018-12-22
視頻示例有誤,沒(méi)有使用@Mapper,所以無(wú)法被掃描到,自然就沒(méi)實(shí)例化,應(yīng)在public前加上:
@Mapper
public interface AreaDao{
}
2018-03-06
我在網(wǎng)上查的這個(gè)問(wèn)題的原因是接口無(wú)法被實(shí)例化到spring容器中,但是不知道怎么解決它
2018-03-06
報(bào)名可以任意起啊,不一定非用imooc啊,謝謝