求大佬指点
- 结构图
- 如果加上ComponentScan扫描就会报错,不加启动是可以查出数据的,连接数据库也是成功的
- 加上报错如下
Error creating bean with name 'teacherMapper' defined in file [I:\GuLi\service\service-edu\target\classes\com\edu\mapper\TeacherMapper.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
确实有点怪,可能是
com
包太大了,导致扫描到其它模块中的东西了,而其它模块正好功能不太全,导致此报错,而不加@ComponentScan
注解的话,只扫描本模块内的东西,所以正常运行。