UnsatisfiedDependencyException Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
时间: 2023-10-19 08:34:34 浏览: 87
UnsatisfiedDependencyException是一个异常,其意思是属性'sqlSessionFactory'或'sqlSessionTemplate'是必需的。
解决这个问题有两种方法。第一种方法是通过详解MapperScannerConfigurer之sqlSessionFactory注入方式的相关资料,可以参考来解决这个问题。
第二种方法是引用相关依赖,比如在springBoot集成mybatis-plus时,可以使用以下依赖来自动注入sqlSessionFactory:
```xml
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>${mybatis-plus-boot-starter.version}</version>
</dependency>
```
<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [Property ‘sqlSessionFactory‘ or ‘sqlSessionTemplate‘ are required](https://blog.csdn.net/qq_63815371/article/details/122212515)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [详解 MapperScannerConfigurer之sqlSessionFactory注入方式](https://download.csdn.net/download/weixin_38654944/12827659)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文