当前位置:   article > 正文

Property ‘sqlSessionFactory’ or ‘sqlSessionTemplate’ are required 缺少数据库连接池的包_abstractroutingdatasource property 'sqlsessionfact

abstractroutingdatasource property 'sqlsessionfactory' or 'sqlsessiontemplat

先添加

  1. <dependency>
  2.     <groupId>org.mybatis.spring.boot</groupId>
  3.     <artifactId>mybatis-spring-boot-starter</artifactId>
  4.     <version>2.0.0</version>
  5. </dependency>

其实最重要的应该是缺少如下数据库连接池的包,当使用时druid,这里要添加druid for spring boot依赖,如下:

  1. <dependency>
  2.     <groupId>com.alibaba</groupId>
  3.     <artifactId>druid-spring-boot-starter</artifactId>
  4.     <version>1.1.9</version>
  5. </dependency>

添加上后项目启动正常。

附加:@Mapper注解对应的包

  1. <!--缺少此jar包,导致@Mapper注解无效-->
  2. <dependency>
  3. <groupId>org.mybatis.spring.boot</groupId>
  4. <artifactId>mybatis-spring-boot-starter</artifactId>
  5. <version>1.2.0</version>
  6. </dependency>

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/662264
推荐阅读
相关标签
  

闽ICP备14008679号