java 将Sping Boot 从2.1.9升级到2.2后出现不可访问对象异常

06odsfpq  于 2023-01-04  发布在  Java
关注(0)|答案(2)|浏览(138)

我的应用在升级前运行良好,但出现以下异常:

Exception in Application init method
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:464)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1051)

Caused by: java.lang.RuntimeException: Exception in Application init method
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:895)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
at java.base/java.lang.Thread.run(Thread.java:830)

Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make public abstract java.lang.String com.sun.javafx.beans.IDProperty.value() accessible: module javafx.base does not "exports com.sun.javafx.beans" to unnamed module @6293abcc
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:344)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:284)
at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:198)
at java.base/java.lang.reflect.Method.setAccessible(Method.java:192)
at org.springframework.core.annotation.AttributeMethods.<init>(AttributeMethods.java:80)
at org.springframework.core.annotation.AttributeMethods.compute(AttributeMethods.java:272)
at java.base/java.util.concurrent.ConcurrentMap.computeIfAbsent(ConcurrentMap.java:330)
at org.springframework.core.annotation.AttributeMethods.forAnnotationType(AttributeMethods.java:255)
at org.springframework.core.annotation.AnnotationsScanner.getDeclaredAnnotations(AnnotationsScanner.java:467)
at org.springframework.core.annotation.AnnotationsScanner.getDeclaredAnnotations(AnnotationsScanner.java:439)
at org.springframework.core.annotation.AnnotationsScanner.processClassHierarchy(AnnotationsScanner.java:210)
at org.springframework.core.annotation.AnnotationsScanner.processClassHierarchy(AnnotationsScanner.java:227)
at org.springframework.core.annotation.AnnotationsScanner.processClassHierarchy(AnnotationsScanner.java:227)
at org.springframework.core.annotation.AnnotationsScanner.processClassHierarchy(AnnotationsScanner.java:227)
at org.springframework.core.annotation.AnnotationsScanner.processClassHierarchy(AnnotationsScanner.java:227)
at org.springframework.core.annotation.AnnotationsScanner.processClassHierarchy(AnnotationsScanner.java:227)
at org.springframework.core.annotation.AnnotationsScanner.processClassHierarchy(AnnotationsScanner.java:194)
at org.springframework.core.annotation.AnnotationsScanner.processClass(AnnotationsScanner.java:130)
at org.springframework.core.annotation.AnnotationsScanner.process(AnnotationsScanner.java:107)
at org.springframework.core.annotation.AnnotationsScanner.scan(AnnotationsScanner.java:97)
at org.springframework.core.annotation.AnnotationsScanner.scan(AnnotationsScanner.java:78)
at org.springframework.core.annotation.TypeMappedAnnotations.scan(TypeMappedAnnotations.java:242)
at org.springframework.core.annotation.TypeMappedAnnotations.isPresent(TypeMappedAnnotations.java:98)
at org.springframework.boot.context.properties.ConfigurationPropertiesBean$BindMethod.isConstructorBindingType(ConfigurationPropertiesBean.java:308)
at org.springframework.boot.context.properties.ConfigurationPropertiesBean$BindMethod.forClass(ConfigurationPropertiesBean.java:300)
at org.springframework.boot.context.properties.ConfigurationPropertiesBeanDefinitionValidator.validate(ConfigurationPropertiesBeanDefinitionValidator.java:57)
at org.springframework.boot.context.properties.ConfigurationPropertiesBeanDefinitionValidator.postProcessBeanFactory(ConfigurationPropertiesBeanDefinitionValidator.java:45)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:286)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:174)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:706)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
at com.mdenis.mdhis3_service.core.MDHIS3_Service.init(MDHIS3_Service.java:109)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:824)
... 2 more

这是一个用Maven编译的Sping Boot / JavaFX项目。甚至不知道从哪里开始,这是一个相当大的项目,在2.1.9上一切都运行得很好。我现在不会提供任何代码示例,因为我真的不知道这个错误是从哪里来的,而且stacktrace只指向我的主类,这是入口点。你知道从哪里开始吗?

yqhsw0fo

yqhsw0fo1#

修正被添加到明天到期的SpringFramework5.2.1里程碑中。干杯!

neskvpey

neskvpey2#

我遇到了同样的问题,问题是我的eclipse sts指向错误的JRE,我安装的java和JRE版本是1. 8. 0,我的eclipse sts指向一些openJDK,纠正后。我的应用程序开始工作!!

相关问题