首页 > 数据库 >Property ‘sqlSessionFactory‘ or ‘sqlSessionTemplate‘ are required

Property ‘sqlSessionFactory‘ or ‘sqlSessionTemplate‘ are required

时间:2023-03-21 18:04:01浏览次数:39  
标签:sqlSessionFactory sqlSessionTemplate spring boot 解决方案 mybatis org Property start


# 情景
今天在搭建springboot+mybatis环境的时候遇到的问题,大概率是版本导致的冲突问题

# 解决
1. 第一种解决方案
<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>

上面的配置换成下面的依赖

<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.2.0</version>
</dependency>


2. 第二种解决方案
添加如下依赖
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.1.9</version>
</dependency>

标签:sqlSessionFactory,sqlSessionTemplate,spring,boot,解决方案,mybatis,org,Property,start
From: https://blog.51cto.com/u_16021118/6140745

相关文章