Skip to content
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

Xjar启动异常:尚不支持新的Java类文件版本 #133

Open
choubuzhaole opened this issue Jan 22, 2024 · 17 comments
Open

Xjar启动异常:尚不支持新的Java类文件版本 #133

choubuzhaole opened this issue Jan 22, 2024 · 17 comments

Comments

@choubuzhaole
Copy link

springboot 升级到 3.2.0 后 xjar 启动失败,原jar 包能正常运行。

错误信息如下:

Dec 14 02:22:17 bogon xjar[21625]: 2023-12-14T02:22:17.881Z  WARN 21631 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: URL [jar:[file:/opt/nezha/nz-web/nz-admin.xjar!/BOOT-INF/classes!/com/nis/setup/controller/SetupController.class](http://file/opt/nezha/nz-web/nz-admin.xjar!/BOOT-INF/classes!/com/nis/setup/controller/SetupController.class)]
Dec 14 02:22:21 bogon xjar[21625]: 2023-12-14T02:22:21.144Z ERROR 21631 --- [           main] o.s.boot.SpringApplication               : Application run failed
Dec 14 02:22:21 bogon xjar[21625]: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: URL [jar:[file:/opt/nezha/nz-web/nz-admin.xjar!/BOOT-INF/classes!/com/nis/setup/controller/SetupController.class](http://file/opt/nezha/nz-web/nz-admin.xjar!/BOOT-INF/classes!/com/nis/setup/controller/SetupController.class)]
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.scanCandidateComponents(ClassPathScanningCandidateComponentProvider.java:484)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:337)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:277)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.context.annotation.ComponentScanAnnotationParser.parse(ComponentScanAnnotationParser.java:128)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:296)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:245)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:196)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:164)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:416)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:289)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:349)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:118)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:775)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:597)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:753)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:455)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:323)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:1342)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:1331)
Dec 14 02:22:21 bogon xjar[21625]: at com.nis.AdminApplication.main(AdminApplication.java:30)
Dec 14 02:22:21 bogon xjar[21625]: at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
Dec 14 02:22:21 bogon xjar[21625]: at java.base/java.lang.reflect.Method.invoke(Method.java:580)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.boot.loader.Launcher.launch(Launcher.java:95)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
Dec 14 02:22:21 bogon xjar[21625]: at io.xjar.boot.XJarLauncher.launch(XJarLauncher.java:26)
Dec 14 02:22:21 bogon xjar[21625]: at io.xjar.boot.XJarLauncher.main(XJarLauncher.java:22)
Dec 14 02:22:21 bogon xjar[21625]: Caused by: [java.io](http://java.io/).IOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet: URL [jar:[file:/opt/nezha/nz-web/nz-admin.xjar!/BOOT-INF/classes!/com/nis/setup/controller/SetupController.class](http://file/opt/nezha/nz-web/nz-admin.xjar!/BOOT-INF/classes!/com/nis/setup/controller/SetupController.class)]
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.core.type.classreading.SimpleMetadataReader.getClassReader(SimpleMetadataReader.java:59)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:48)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:103)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:122)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.scanCandidateComponents(ClassPathScanningCandidateComponentProvider.java:456)
Dec 14 02:22:21 bogon xjar[21625]: ... 27 common frames omitted
Dec 14 02:22:21 bogon xjar[21625]: Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 10864
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.asm.ClassReader.<init>(ClassReader.java:199)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.asm.ClassReader.<init>(ClassReader.java:180)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.asm.ClassReader.<init>(ClassReader.java:166)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.asm.ClassReader.<init>(ClassReader.java:287)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.core.type.classreading.SimpleMetadataReader.getClassReader(SimpleMetadataReader.java:56)
Dec 14 02:22:21 bogon xjar[21625]: ... 31 common frames omitted
Dec 14 02:22:21 bogon xjar[21625]: panic: exit status 1
Dec 14 02:22:21 bogon xjar[21625]: goroutine 1 [running]:
Dec 14 02:22:21 bogon xjar[21625]: main.main()
Dec 14 02:22:21 bogon xjar[21625]: /opt/nezha/nz-web/xjar.go:86 +0x710
Dec 14 02:22:21 bogon systemd[1]: nz-web.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Dec 14 02:22:21 bogon systemd[1]: Unit nz-web.service entered failed state.
Dec 14 02:22:21 bogon systemd[1]: nz-web.service failed.
@sirolei
Copy link

sirolei commented Jan 29, 2024

@choubuzhaole 遇到和你一样的问题,你有解决这个吗?

@choubuzhaole
Copy link
Author

@choubuzhaole 遇到和你一样的问题,你有解决这个吗?

没有,准备转移到 graalvm 了,看着这个项目都没有人维护了

@jlynet
Copy link

jlynet commented Mar 1, 2024

@choubuzhaole 遇到和你一样的问题,你有解决这个吗?

没有,准备转移到 graalvm 了,看着这个项目都没有人维护了
你们搞graalvm了吗?这个好像也很多问题。编译了运行不起来。有时间一起交流下吗?

@choubuzhaole
Copy link
Author

@choubuzhaole遇到和你一样的问题,你解决了吗?

没有,准备转移到graalvm了,看着这个项目都没有人维护了
你们搞graalvm了吗?这个愿望也很多问题。编译了运行不起来。有时间一起交流下吗?
没问题,找个同行者

@leewi9
Copy link

leewi9 commented Mar 13, 2024

有没有更好的还在维护的项目,老外有没有开发过类似的,github搜了一圈居然没有...

@qcz-left
Copy link

qcz-left commented Mar 14, 2024

这是因为SpringBoot启动时要扫描组件, Spring升级到6之后,没有使用到自定义的 URLStreamHandler,即:XBootURLHandler.java,在看 spring-core 里面有个 UrlResource,里面的 createRelativeURL 方法有调整,这个方法最后一行return 那里由 new URL(this.url, relativePath) 调整为了 ResourceUtils.toRelativeURL(this.url, relativePath),就是这一段导致加载class时没有找到自定义 URLStreamHandler 处理器,所以也就没法解密class,然后就报错:Caused by: java.lang.IllegalArgumentException: Unsupported class file major version xxx。

有兴趣可以点到 URL 这个类的源码里面看看,有一段代码是这样写的,context 相当于这个class的父级,SpringBoot3.2.0版本 中,由于这个context为null,导致handle没有进行赋值,在SpringBoot2.x的版本中是有值的,且这个handle就是自定义 URLStreamHandler 处理器,context将自身的handle传递给到了所需要加载的class,所以能成功解密。

if ((context != null) && ((newProtocol == null) ||
                            newProtocol.equalsIgnoreCase(context.protocol))) {
    // inherit the protocol handler from the context
    // if not specified to the constructor
    if (handler == null) {
        handler = context.handler;
    }
}

有一个方法可以解决,那就是修改 spring-core的源码,将UrlResource.createRelativeURL 方法中的 ResourceUtils.toRelativeURL(this.url, relativePath) 改为 new URL(this.url, relativePath) ,重新编译安装spring-core 到本地仓库即可

@Hwatu
Copy link

Hwatu commented Apr 8, 2024

这是因为SpringBoot启动时要扫描组件, Spring升级到6之后,没有使用到自定义的 URLStreamHandler,即:XBootURLHandler.java,在看 spring-core 里面有个 UrlResource,里面的 createRelativeURL 方法有调整,这个方法最后一行return 那里由 new URL(this.url, relativePath) 调整为了 ResourceUtils.toRelativeURL(this.url, relativePath),就是这一段导致加载class时没有找到自定义 URLStreamHandler 处理器,所以也就没法解密class,然后就报错:Caused by: java.lang.IllegalArgumentException: Unsupported class file major version xxx。

有兴趣可以点到 URL 这个类的源码里面看看,有一段代码是这样写的,context 相当于这个class的父级,SpringBoot3.2.0版本 中,由于这个context为null,导致handle没有进行赋值,在SpringBoot2.x的版本中是有值的,且这个handle就是自定义 URLStreamHandler 处理器,context将自身的handle传递给到了所需要加载的class,所以能成功解密。

if ((context != null) && ((newProtocol == null) ||
                            newProtocol.equalsIgnoreCase(context.protocol))) {
    // inherit the protocol handler from the context
    // if not specified to the constructor
    if (handler == null) {
        handler = context.handler;
    }
}

有一个方法可以解决,那就是修改 spring-core的源码,将UrlResource.createRelativeURL 方法中的 ResourceUtils.toRelativeURL(this.url, relativePath) 改为 new URL(this.url, relativePath) ,重新编译安装spring-core 到本地仓库即可

大佬,有编译好的吗?我也遇到这个问题了

@qcz-left
Copy link

qcz-left commented Apr 9, 2024

这是因为SpringBoot启动时要扫描组件, Spring升级到6之后,没有使用到自定义的 URLStreamHandler,即:XBootURLHandler.java,在看 spring-core 里面有个 UrlResource,里面的 createRelativeURL 方法有调整,这个方法最后一行return 那里由 new URL(this.url, relativePath) 调整为了 ResourceUtils.toRelativeURL(this.url, relativePath),就是这一段导致加载class时没有找到自定义 URLStreamHandler 处理器,所以也就没法解密class,然后就报错:Caused by: java.lang.IllegalArgumentException: Unsupported class file major version xxx。
有兴趣可以点到 URL 这个类的源码里面看看,有一段代码是这样写的,context 相当于这个class的父级,SpringBoot3.2.0版本 中,由于这个context为null,导致handle没有进行赋值,在SpringBoot2.x的版本中是有值的,且这个handle就是自定义 URLStreamHandler 处理器,context将自身的handle传递给到了所需要加载的class,所以能成功解密。

if ((context != null) && ((newProtocol == null) ||
                            newProtocol.equalsIgnoreCase(context.protocol))) {
    // inherit the protocol handler from the context
    // if not specified to the constructor
    if (handler == null) {
        handler = context.handler;
    }
}

有一个方法可以解决,那就是修改 spring-core的源码,将UrlResource.createRelativeURL 方法中的 ResourceUtils.toRelativeURL(this.url, relativePath) 改为 new URL(this.url, relativePath) ,重新编译安装spring-core 到本地仓库即可

大佬,有编译好的吗?我也遇到这个问题了

spring-core-6.1.1a.zip

改.zip为.jar,自己用一下就行了,毕竟没有测试过,不清楚会不会有其他未知的问题

@qcz-left
Copy link

qcz-left commented Apr 9, 2024

这是因为SpringBoot启动时要扫描组件, Spring升级到6之后,没有使用到自定义的 URLStreamHandler,即:XBootURLHandler.java,在看 spring-core 里面有个 UrlResource,里面的 createRelativeURL 方法有调整,这个方法最后一行return 那里由 new URL(this.url, relativePath) 调整为了 ResourceUtils.toRelativeURL(this.url, relativePath),就是这一段导致加载class时没有找到自定义 URLStreamHandler 处理器,所以也就没法解密class,然后就报错:Caused by: java.lang.IllegalArgumentException: Unsupported class file major version xxx。
有兴趣可以点到 URL 这个类的源码里面看看,有一段代码是这样写的,context 相当于这个class的父级,SpringBoot3.2.0版本 中,由于这个context为null,导致handle没有进行赋值,在SpringBoot2.x的版本中是有值的,且这个handle就是自定义 URLStreamHandler 处理器,context将自身的handle传递给到了所需要加载的class,所以能成功解密。

if ((context != null) && ((newProtocol == null) ||
                            newProtocol.equalsIgnoreCase(context.protocol))) {
    // inherit the protocol handler from the context
    // if not specified to the constructor
    if (handler == null) {
        handler = context.handler;
    }
}

有一个方法可以解决,那就是修改 spring-core的源码,将UrlResource.createRelativeURL 方法中的 ResourceUtils.toRelativeURL(this.url, relativePath) 改为 new URL(this.url, relativePath) ,重新编译安装spring-core 到本地仓库即可

大佬,有编译好的吗?我也遇到这个问题了

spring-core-6.1.1a.zip

改.zip为.jar,自己用一下就行了,毕竟没有测试过,不清楚会不会有其他未知的问题

@Hwatu

@zhaoyuan-72
Copy link

有没有更好的还在维护的项目,老外有没有开发过类似的,github搜了一圈居然没有...

请问有找到什么替代方案吗

@fendo8888
Copy link

官方找到了一个修复方法:spring-projects/spring-framework#33561

@zzqo
Copy link

zzqo commented Sep 23, 2024

ResourceUtils.toURL(root.tostring()).equals(root)会一直返回true,并不能解决

@MisterChangRay
Copy link

看老大一直不解决。
于是拉取了新分支支持springboot3
目前在springboot3.2.3+jdk17中验证通过
项目地址 https://github.com/MisterChangRay/xjar4springboot3

@MisterChangRay
Copy link

springboot 升级到 3.2.0 后 xjar 启动失败,原jar 包能正常运行。

错误信息如下:

Dec 14 02:22:17 bogon xjar[21625]: 2023-12-14T02:22:17.881Z  WARN 21631 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: URL [jar:[file:/opt/nezha/nz-web/nz-admin.xjar!/BOOT-INF/classes!/com/nis/setup/controller/SetupController.class](http://file/opt/nezha/nz-web/nz-admin.xjar!/BOOT-INF/classes!/com/nis/setup/controller/SetupController.class)]
Dec 14 02:22:21 bogon xjar[21625]: 2023-12-14T02:22:21.144Z ERROR 21631 --- [           main] o.s.boot.SpringApplication               : Application run failed
Dec 14 02:22:21 bogon xjar[21625]: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: URL [jar:[file:/opt/nezha/nz-web/nz-admin.xjar!/BOOT-INF/classes!/com/nis/setup/controller/SetupController.class](http://file/opt/nezha/nz-web/nz-admin.xjar!/BOOT-INF/classes!/com/nis/setup/controller/SetupController.class)]
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.scanCandidateComponents(ClassPathScanningCandidateComponentProvider.java:484)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:337)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:277)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.context.annotation.ComponentScanAnnotationParser.parse(ComponentScanAnnotationParser.java:128)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:296)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:245)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:196)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:164)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:416)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:289)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:349)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:118)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:775)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:597)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:753)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:455)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:323)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:1342)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:1331)
Dec 14 02:22:21 bogon xjar[21625]: at com.nis.AdminApplication.main(AdminApplication.java:30)
Dec 14 02:22:21 bogon xjar[21625]: at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
Dec 14 02:22:21 bogon xjar[21625]: at java.base/java.lang.reflect.Method.invoke(Method.java:580)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.boot.loader.Launcher.launch(Launcher.java:95)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
Dec 14 02:22:21 bogon xjar[21625]: at io.xjar.boot.XJarLauncher.launch(XJarLauncher.java:26)
Dec 14 02:22:21 bogon xjar[21625]: at io.xjar.boot.XJarLauncher.main(XJarLauncher.java:22)
Dec 14 02:22:21 bogon xjar[21625]: Caused by: [java.io](http://java.io/).IOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet: URL [jar:[file:/opt/nezha/nz-web/nz-admin.xjar!/BOOT-INF/classes!/com/nis/setup/controller/SetupController.class](http://file/opt/nezha/nz-web/nz-admin.xjar!/BOOT-INF/classes!/com/nis/setup/controller/SetupController.class)]
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.core.type.classreading.SimpleMetadataReader.getClassReader(SimpleMetadataReader.java:59)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:48)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:103)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:122)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.scanCandidateComponents(ClassPathScanningCandidateComponentProvider.java:456)
Dec 14 02:22:21 bogon xjar[21625]: ... 27 common frames omitted
Dec 14 02:22:21 bogon xjar[21625]: Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 10864
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.asm.ClassReader.<init>(ClassReader.java:199)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.asm.ClassReader.<init>(ClassReader.java:180)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.asm.ClassReader.<init>(ClassReader.java:166)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.asm.ClassReader.<init>(ClassReader.java:287)
Dec 14 02:22:21 bogon xjar[21625]: at org.springframework.core.type.classreading.SimpleMetadataReader.getClassReader(SimpleMetadataReader.java:56)
Dec 14 02:22:21 bogon xjar[21625]: ... 31 common frames omitted
Dec 14 02:22:21 bogon xjar[21625]: panic: exit status 1
Dec 14 02:22:21 bogon xjar[21625]: goroutine 1 [running]:
Dec 14 02:22:21 bogon xjar[21625]: main.main()
Dec 14 02:22:21 bogon xjar[21625]: /opt/nezha/nz-web/xjar.go:86 +0x710
Dec 14 02:22:21 bogon systemd[1]: nz-web.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Dec 14 02:22:21 bogon systemd[1]: Unit nz-web.service entered failed state.
Dec 14 02:22:21 bogon systemd[1]: nz-web.service failed.

拉取了新分支,支持springboot3
目前在springboot3.2.3+jdk17中验证通过
需要的道友请移步 https://github.com/MisterChangRay/xjar4springboot3

@IOTWord
Copy link

IOTWord commented Sep 30, 2024

graalvm

找到其他的工具了吗?推荐推荐啊

@qcz-left
Copy link

spring-core:6.1.14 官方已修复,可以解密了

@zzqo
Copy link

zzqo commented Nov 12, 2024

spring-boot:3.3.5已经用上spring-core:6.1.14了,可以用这个版本来试一试

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests