Sentinel Dashboard can not start: java.lang.reflect.InaccessibleObjectException | 控制台本地启动不了

zte4gxcn  于 2021-11-29  发布在  Java
关注(0)|答案(3)|浏览(879)

为什么本地启动不了,它总是报反射错误,但是我jdk版本是对的

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 @3a82ac97

Caused by: org.springframework.cglib.core.CodeGenerationException: 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 @3a82ac97

java.lang.IllegalStateException: Cannot load configuration class: com.alibaba.csp.sentinel.dashboard.DashboardApplication

jdk版本1.8

tf7tbtn2

tf7tbtn21#

java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @3a82ac97

这个看起来是 JDK 9+ 的版本,可否提供下具体版本

brtdzjyr

brtdzjyr2#

sentinel-dashboard-1.8.2.jar
sentinel-dashboard-1.7.1.jar
sentinel-dashboard-1.7.0.jar
这三个版本的,我看官网说了只要Java6以上就行,不太想改根目录的jdk版本,会有冲突

zf2sa74q

zf2sa74q3#

感觉像是JDK 9+的问题,我用JDK 17的时候遇到了类似的问题。试试增加VM选项

--add-opens java.base/java.lang=ALL-UNNAMED

看看还报不报错。
StackOverflow上有相关的讨论 https://stackoverflow.com/questions/41265266/how-to-solve-inaccessibleobjectexception-unable-to-make-member-accessible-m

相关问题