-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
springboot 3 整合 pagehelper 报错 Caused by: java.lang.NoClassDefFoundError: net/sf/jsqlparser/statement/select/SelectBody #817
Comments
jsqlparser 4.9 的问题,jsqlparser 几乎每个版本都不兼容。 |
4.9和4.7是兼容的,可以用下面方式进行配置: <dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>sqlparser4.7</artifactId>
<version>6.1.0</version>
</dependency>
<dependency>
<groupId>com.github.jsqlparser</groupId>
<artifactId>jsqlparser</artifactId>
<version>4.9</version>
</dependency> |
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.github.pagehelper.autoconfigure.PageHelperAutoConfiguration': net/sf/jsqlparser/statement/select/SelectBody 已添加上述依赖, 还是报错 |
` SpringBoot: 3.3.2 思路如下: com.github.yulichang mybatis-plus-join-boot-starter 1.4.6 -> com.github.yulichang mybatis-plus-join-boot-starter 1.5.2 com.github.jsqlparser com.github.jsqlparser jsqlparser ${jsqlparser.version} <mybatis.version>3.5.10</mybatis.version> <mybatis-plus.version>3.5.3.1</mybatis-plus.version> <pagehelper-spring-boot-starter.version>1.4.5</pagehelper-spring-boot-starter.version> com.baomidou mybatis-plus-boot-starter ${mybatis-plus.version} com.baomidou mybatis-plus-spring-boot3-starter ${mybatis-plus.version} |
2024-05-15 11:44:39.626 ERROR [ main] [] o.s.boot.SpringApplication [820] : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.github.pagehelper.autoconfigure.PageHelperAutoConfiguration': net/sf/jsqlparser/statement/select/SelectBody
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1751)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:961)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:915)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:584)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:432)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:308)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1302)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1291)
at com.xstc.admin.AdminApplication.main(AdminApplication.java:18)
Caused by: java.lang.NoClassDefFoundError: net/sf/jsqlparser/statement/select/SelectBody
at com.github.pagehelper.PageHelper.setProperties(PageHelper.java:158)
at com.github.pagehelper.PageInterceptor.setProperties(PageInterceptor.java:221)
at com.github.pagehelper.autoconfigure.PageHelperAutoConfiguration.afterPropertiesSet(PageHelperAutoConfiguration.java:65)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1797)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1747)
... 16 common frames omitted
Caused by: java.lang.ClassNotFoundException: net.sf.jsqlparser.statement.select.SelectBody
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
... 21 common frames omitted
2024-05-15 11:44:42.650 WARN [ Thread-5] [] c.a.n.common.http.HttpClientBeanHolder [102] : [HttpClientBeanHolder] Start destroying common HttpClient
2024-05-15 11:44:42.650 WARN [ Thread-13] [] c.a.nacos.common.notify.NotifyCenter [136] : [NotifyCenter] Start destroying Publisher
Disconnected from the target VM, address: '127.0.0.1:63053', transport: 'socket'
The text was updated successfully, but these errors were encountered: