[WARNING] Nested in org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.che.service.UserService com.che.controller.UserController.userService; nested exception is java.lang.NoClassDefFoundError: org/apache/ibatis/transaction/TransactionFactory:
java.lang.ClassNotFoundException: org.apache.ibatis.transaction.TransactionFactory
整合时不能创建bean,困扰一周,今天在拿出来去百度了一下这个错误,人家说我没有引入mybatis的jar包,我就去pom.xml里看,重新引入了一个,吧之前的屏蔽掉了,然后!!!运行成功!!!
依赖里面的<scope>有大问题,就是多了这行,一直报错,删掉就OK了。
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.1</version>
<scope>test</scope>
</dependency>