何时能真正支持JDK17,目前通过命令行参数方式启动,此种方式很麻烦,并且运行过程中可能会出现新的需要被放行的模块,极易引发生产事故。
[apache/dubbo]何时能真正支持JDK17
回答
3.2 版本已经原生支持 JDK17,目前大量的测试已经在 JDK17 上运行了。目前 3.2 是 beta 状态,预计会在 3 月份正式 release。
3.2 版本已经原生支持 JDK17,目前大量的测试已经在 JDK17 上运行了。目前 3.2 是 beta 状态,预计会在 3 月份正式 release。
目前来看并不是原生支持,如果我加上--add-opens就不报错
图片没有上传成功目前用的3.2 beta4版本 Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @5bf0d49 at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354) at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297) at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199) at java.base/java.lang.reflect.Method.setAccessible(Method.java:193) at javassist.ClassPool.toClass2(ClassPool.java:1181) at javassist.ClassPool.toClass(ClassPool.java:1164) at org.apache.dubbo.common.compiler.support.JavassistCompiler.doCompile(JavassistCompiler.java:97) at org.apache.dubbo.common.compiler.support.AbstractCompiler.compile(AbstractCompiler.java:70) at org.apache.dubbo.common.compiler.support.AdaptiveCompiler.compile(AdaptiveCompiler.java:53) at org.apache.dubbo.common.extension.ExtensionLoader.createAdaptiveExtensionClass(ExtensionLoader.java:1341) at org.apache.dubbo.common.extension.ExtensionLoader.getAdaptiveExtensionClass(ExtensionLoader.java:1325) at org.apache.dubbo.common.extension.ExtensionLoader.createAdaptiveExtension(ExtensionLoader.java:1309) ... 26 common frames omitted [traceId: ] 2023-02-01 16:29:59 [Thread-1] WARN com.alibaba.nacos.common.http.HttpClientBeanHolder - [HttpClientBeanHolder] Start destroying common HttpClient [traceId: ] 2023-02-01 16:29:59 [DubboShutdownHook] INFO org.apache.dubbo.config.DubboShutdownHook - [DUBBO] Run shutdown hook now., dubbo version: 3.2.0-beta.4, current host: 10.88.107.34 [traceId: ] 2023-02-01 16:29:59 [Thread-6] WARN com.alibaba.nacos.common.notify.NotifyCenter - [NotifyCenter] Start destroying Publisher [traceId: ] 2023-02-01 16:29:59 [Thread-6] WARN com.alibaba.nacos.common.notify.NotifyCenter - [NotifyCenter] Destruction of the end [traceId: ] 2023-02-01 16:29:59 [DubboShutdownHook] INFO org.apache.dubbo.config.DubboShutdownHook - [DUBBO] Waiting for modules managed by Spring to be shut down., dubbo version: 3.2.0-beta.4, current host: 10.88.107.34 [traceId: ] 2023-02-01 16:29:59 [Thread-1] WARN com.alibaba.nacos.common.http.HttpClientBeanHolder - [HttpClientBeanHolder] Destruction of the end Disconnected from the target VM, address: '127.0.0.1:50164', transport: 'socket'
Process finished with exit code 1
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @5bf0d49
这个是 javaassist 版本的问题,Dubbo 传递的是高版本的,看下是不是有冲突
希望加快支持jdk17进度
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @5bf0d49
这个是 javaassist 版本的问题,Dubbo 传递的是高版本的,看下是不是有冲突 确实有一个低版本的,现在删除低版本的javaassist就好了,多谢