SpringBoot简单搭建报错:Field userDao in com.example.service.UserService required a bean of type ‘com.example.dao.IUserDao’ that could not be found
刚开始写了一个demo玩玩只是这句报错,然后调了好久,没出来就去干其他事了,周一找组里大神调了一下,加了这句:
这句是扫描那个Dao的包,加上后不报找不到的错了,又报这个:sqlSessionFactory’ or ‘sqlSessionTemplate’ are required,
提示说SqlSession乱七八糟找不到了,然后在网上搜了一下,说是pom里面的mybatis版本太高,我降到1.2.1还是报错,最后网上找的另一个方案是加这个
最后,成功启动,并查询,哎呀,这个注解真的有时候搞的人很蒙蔽!!!