确认

  • [X] 我使用的版本是最新版, 并且使用插件确认过项目里无依赖版本冲突
  • [X] 我已经在 issue 中搜索过, 确认问题没有被提出过
  • [X] 我已经修改标题, 将标题中的 描述 替换为遇到的问题

当前程序版本

3.5.8

问题描述

原因好像是jsqlparser5.0版本的编译版本是jdk11

详细堆栈日志

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor]: Factory method 'mybatisPlusInterceptor' threw exception; nested exception is java.lang.UnsupportedClassVersionError: net/sf/jsqlparser/statement/select/SelectItem has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.3.31.jar:5.3.31]
    at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:648) ~[spring-beans-5.3.31.jar:5.3.31]
    ... 76 common frames omitted
Caused by: java.lang.UnsupportedClassVersionError: net/sf/jsqlparser/statement/select/SelectItem has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
    at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.8.0_372]
    at java.lang.ClassLoader.defineClass(ClassLoader.java:756) ~[na:1.8.0_372]
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[na:1.8.0_372]
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:473) ~[na:1.8.0_372]
    at java.net.URLClassLoader.access$100(URLClassLoader.java:74) ~[na:1.8.0_372]
    at java.net.URLClassLoader$1.run(URLClassLoader.java:369) ~[na:1.8.0_372]
    at java.net.URLClassLoader$1.run(URLClassLoader.java:363) ~[na:1.8.0_372]
    at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_372]
    at java.net.URLClassLoader.findClass(URLClassLoader.java:362) ~[na:1.8.0_372]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[na:1.8.0_372]
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352) ~[na:1.8.0_372]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[na:1.8.0_372]
    at com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor.<clinit>(PaginationInnerInterceptor.java:69) ~[mybatis-plus-extension-3.5.8.jar:3.5.8]
    at org.tinycloud.tinyapi.common.config.MybatisPlusConfig.mybatisPlusInterceptor(MybatisPlusConfig.java:27) ~[classes/:na]
    at org.tinycloud.tinyapi.common.config.MybatisPlusConfig$$EnhancerBySpringCGLIB$$58bf9e41.CGLIB$mybatisPlusInterceptor$0(<generated>) ~[classes/:na]
    at org.tinycloud.tinyapi.common.config.MybatisPlusConfig$$EnhancerBySpringCGLIB$$58bf9e41$$FastClassBySpringCGLIB$$6d4efa1a.invoke(<generated>) ~[classes/:na]
    at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.3.31.jar:5.3.31]
    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) ~[spring-context-5.3.31.jar:5.3.31]
    at org.tinycloud.tinyapi.common.config.MybatisPlusConfig$$EnhancerBySpringCGLIB$$58bf9e41.mybatisPlusInterceptor(<generated>) ~[classes/:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_372]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_372]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_372]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_372]
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.3.31.jar:5.3.31]

Comment From: llllllxy

恢复为3.5.7版本时,问题就没有了

Comment From: totoro52

https://github.com/baomidou/mybatis-plus/issues/6497

Comment From: qmdx

请升级 JDK 11 完全兼容 JDK8