springboot整合pagehelper的时候启动报错

springboot启动报错


Caused by: java.lang.NoClassDefFoundError: Lorg/springframework/boot/bind/RelaxedPropertyResolver;
	at java.lang.Class.getDeclaredFields0(Native Method) ~[na:1.8.0_144]
	at java.lang.Class.privateGetDeclaredFields(Class.java:2583) ~[na:1.8.0_144]
	at java.lang.Class.getDeclaredFields(Class.java:1916) ~[na:1.8.0_144]
	at org.springframework.util.ReflectionUtils.getDeclaredFields(ReflectionUtils.java:753) ~[spring-core-5.0.6.RELEASE.jar:5.0.6.RELEASE]
	... 26 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.bind.RelaxedPropertyResolver
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_144]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_144]
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335) ~[na:1.8.0_144]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_144]
	... 30 common frames omitted

自己在进行项目开发的时候,需要从头建立一个新的项目,在引入pagehelper的时候,springboot启动报错了,在网上看了相关的资料以后发现是自己的jar包引入的冲突了

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

        <dependency>
            <groupId>com.github.pagehelper</groupId>
            <artifactId>pagehelper-spring-boot-starter</artifactId>
            <version>1.2.2</version>
        </dependency>

将pagehelper的jar包版本从1.2.2改为1.2.3以后错误就消失了,特此记录。

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

        <dependency>
            <groupId>com.github.pagehelper</groupId>
            <artifactId>pagehelper-spring-boot-starter</artifactId>
            <version>1.2.3</version>
        </dependency>

猜你喜欢

转载自blog.csdn.net/weixin_44130081/article/details/89398863
今日推荐