Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.javasm.student.service.ITbStudentService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@javax.annotation.Resource(shareable=true, lookup=, name=, description=, authenticationType=CONTAINER, type=class java.lang.Object, mappedName=)}
原因:注解使用错误。
在启动类中使用@ComponentScan("com.javatk.*.mapper")配置了映射文件的路径
改为@MapperScan("com.javatk.*.mapper")后运行成功。同时注意用代码生成器生成的mapper文件夹下的接口不用加注解