baomidou / mybatis-plus

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

spring boot 2.2.0.RELEASE整合3.2.0版本报错 #1732

Closed Exrick closed 4 years ago

Exrick commented 4 years ago

当前使用版本(必须填写清楚,否则不予处理)

3.2.0

该问题是怎么引起的?*([最新版](https://search.maven.org/search?q=g:com.baomidou%20a:mybatis-)上已修复的会直接close掉)**

spring-boot-2.2.0中使用

重现步骤

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.2.0.RELEASE</version>
    </parent>

        <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-boot-starter</artifactId>
            <version>3.2.0</version>
        </dependency>

报错信息

QQ20191021-0.jpg

miemieYaho commented 4 years ago

给出你的复现demo

yia115 commented 4 years ago

我升级到springboot 2.2.0 报同样的错误,mybatis-plus版本 3.1.2

Exrick commented 4 years ago

去除依赖 jasypt-spring-boot-starter 解决

yia115 commented 4 years ago

要如何整合jasypt,才不会报错

yia115 commented 4 years ago

要如何整合jasypt,才不会报错

jasypt: encryptor: password: password proxy-property-sources: true 在application.yml中增加proxy-property-sources: true该配置即可

hollymiky commented 4 years ago

遇到相同问题

djvip001 commented 4 years ago

+1 除了springboot降到2.1.x 还有什么解决办法吗

Exrick commented 4 years ago

别人不都发了吗

jasypt:
  encryptor:
    password: password
    proxy-property-sources: true
yejianmail commented 4 years ago

这根本不是解决办法,我尝试了没用,而且项目里面没有jaspyt的依赖,我开了一个issue一会就被colse掉了还让我搜索!这个答案我是之前就看过了的!

yia115 commented 4 years ago

这根本不是解决办法,我尝试了没用,而且项目里面没有jaspyt的依赖,我开了一个issue一会就被colse掉了还让我搜索!这个答案我是之前就看过了的!

更新springboot 版本到2.2.1,可以解决这个问题

jianguyuxing commented 4 years ago

springboot2.2.0 的bug。升级到springboot2.2.1及以上版本解决。

现象: 1.本地启动无问题,打成war包部署到服务器报此问题

原因:springboot 2.2.0 构造器注入的问题, mybatis 私有构造器不能绑定属性, 造成依赖mybatis的框架比如MP报错 [参考issue](https://github.com/spring-projects/spring-boot/issues/18670) 此问题已在springboot2.2.1中修复

解决方案:1.将springboot降级到2.1.x或升级到2.2.1起 (建议springboot2.2.2)