java.lang.ClassNotFoundException: org.springframework.boot.bind.RelaxedPropertyResolver 错误解决

时间:2022-02-14 13:26:51

1.今天在搭建SpringBoot整合 pageHelper的时候报错如下


1.1 引入依赖如下:

<!-- 分页插件 -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.2</version>
</dependency>

1.2 报错内容如下

Caused by: java.lang.ClassNotFoundException: org.springframework.boot.bind.RelaxedPropertyResolver
at java.net.URLClassLoader.findClass(Unknown Source) ~[na:1.8.0_191]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.8.0_191]
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) ~[na:1.8.0_191]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.8.0_191]
... 30 common frames omitted

1.2 分析:大致意思是说 这个包没有找到 我猜想可能是版本问题 就去Maven查询依赖

java.lang.ClassNotFoundException: org.springframework.boot.bind.RelaxedPropertyResolver 错误解决

2.解决问题 将pom.xml 里面引入的依赖转变为

<!-- 分页插件 -->
<!-- https://mvnrepository.com/artifact/com.github.pagehelper/pagehelper-spring-boot-starter -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.10</version>
</dependency>