今天遇到一个BUG,启动时无法扫描mybatis别名,但是我在eclipse中就是可以的,打成jar就会报错

Spring Boot 无法扫描 MyBatis别名的Bug

就是找不到这货,然后我就各种百度,终于解决了这个问题,在此记录一下

pom引用

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

 

在SqlSessionFactory中设置 bean.setVfs(SpringBootVFS.class); 在此打包启动,完美解决,至于为啥,有空在了解吧

Spring Boot 无法扫描 MyBatis别名的Bug

 

相关文章:

  • 2021-11-25
  • 2021-10-06
  • 2022-02-16
  • 2021-09-27
  • 2021-10-21
  • 2021-04-09
  • 2022-01-17
  • 2022-12-23
猜你喜欢
  • 2021-10-06
  • 2022-12-23
  • 2022-12-23
  • 2022-02-28
  • 2021-07-13
  • 2022-12-23
  • 2021-06-17
相关资源
相似解决方案