baomidou / mybatis-plus

An powerful enhanced toolkit of MyBatis for simplify development
https://baomidou.com
Apache License 2.0
16.42k stars 4.31k forks source link

Factory method 'sqlSessionFactory' threw exception with message: 'void org.apache.ibatis.session.Configuration.parsePendingResultMaps(boolean)' #6133

Closed 183461750 closed 6 months ago

183461750 commented 6 months ago

当前使用版本

当前环境信息 Java17 + pgsql gradle的依赖版本都放截图上了

描述bug现象 应用启动报错 提供问题复现步骤 每次启动都会报错 提供完整堆栈日志(可选) Error creating bean with name 'testController' defined in file [/Users/fa/dev/projects/IdeaProjects/me/iuin-main/iuin-mall/commodity-service/build/classes/java/main/com/iuin/commodity/controller/TestController.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'comUserServiceImpl' defined in file [/Users/fa/dev/projects/IdeaProjects/me/iuin-main/iuin-mall/commodity-service/build/classes/java/main/com/iuin/commodity/service/impl/ComUserServiceImpl.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'comUserDao': Unsatisfied dependency expressed through field 'baseMapper': Error creating bean with name 'comUserMapper' defined in file [/Users/fa/dev/projects/IdeaProjects/me/iuin-main/iuin-mall/commodity-service/build/classes/java/main/com/iuin/commodity/repostory/mapper/ComUserMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory': Error creating bean with name 'sqlSessionFactory' defined in class path resource [com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.class]: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception with message: 'void org.apache.ibatis.session.Configuration.parsePendingResultMaps(boolean)' 提供问题复现工程(可选) 请尽量提供复现工程,减少大家排错的时间.

image

从报错和截图上看, 貌似是需要个Configuration.parsePendingResultMaps(boolean), 有参的方法, 但mybatis-3.5.16才有这个方法, 在下面有提供对应的截图和链接

image

https://github.com/mybatis/mybatis-3/commit/fba61d2b752a84cb439eb03ae56776da4a1d4af7?diff=split&w=0

我试着手动添加了这个依赖到[mybatis-3.5.16]就正常了

image
miemieYaho commented 6 months ago

mybatis-plus-spring-boot3-starter