Springboot 启动 Property ‘sqlSessionFactory‘ or ‘sqlSessionTemplate‘ are required
脚手架使用阿里云
工具idea,创建mybatis 访问数据库 mapper xml 都配置了提示报错:
Property ‘sqlSessionFactory’ or ‘sqlSessionTemplate’ are required
解决方法:没有按照网络中所说的,添加代码。采用了添加一个配置druid-spring-boot-starter去实现。
实现之后的数据库依赖如下:
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.1.16</version>
</dependency>
问题参考:https://blog.csdn.net/Forever_Devil/article/details/106219237/