
问题:在配置springboot+mysql时,会出现"Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required"显示需要需要将sqlSessionFactory依赖注入。
解决方案:在pom.xml文件内添加如下依赖,然后重新刷新一下maven库即可。
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.3.1</version>
</dependency>

在整合SpringBoot与MySQL时遇到错误提示'Property'sqlSessionFactory'or'sqlSessionTemplate'are required'。为了解决这个问题,只需在项目的pom.xml文件中添加mybatis-spring-boot-starter依赖,指定版本为1.3.1,然后刷新Maven库。这将确保项目能够正确地注入所需的sqlSessionFactory。
4万+

被折叠的 条评论
为什么被折叠?



