今天闲来无事,想到自己写的小项目还用的是springBoot1.x,于是乎就升级了一下。过程中遇到了几个问题记录一下。
一、1.x使用的druid版本在2.x里不兼容
1.x版本
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.0.11</version>
</dependency>
如果springBoot1.x使用此版本没有问题,换成springBoot2.x后会报java.lang.ClassNotFoundExceptionorg.springframework.boot.bind.RelaxedDataBinder的错误,所以将此版本更改为:
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.1.10</version>
</dependency>
二、如果引入了pagehelper的化,我springBoot1.x用的是这个版本
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.1.2</version>
</dependency>
在springBoot2.x里会报错:java.lang.ClassNotFoundException: org.springframework.boot.bind.RelaxedPropertyResolver错误
将版本改成:
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.10</version>
</dependency>