我正在尝试使用 GraalVM 构建 Spring Boot 应用程序的本机映像,但遇到了InaccessibleObjectException
与 相关的问题java.util.Collections$SetFromMap
。我尝试了几种解决方案,但问题仍然存在。
环境:
- GraalVM 版本: 21.0.5(适用于 Java 21 的 GraalVM 21.0.5)
- Java 版本: Java 21
- Spring Boot 版本: 3.3.5
- EclipseStore 版本: 2.0.0(添加此版本会触发问题)
- 操作系统: Sonoma 14.6.1
问题描述:
当我添加EclipseStore
到我的Spring Boot
应用程序并尝试使用构建本机图像时GraalVM
,遇到与相关的以下错误java.util.Collections$SetFromMap
:
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field final java.util.Map java.util.Collections$SetFromMap.m accessible: module java.base does not "opens java.util" to unnamed module @60a7e509
at java.base/java.lang.reflect.AccessibleObject.throwInaccessibleObjectException(AccessibleObject.java:391)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:367)
at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:183)
at java.base/java.lang.reflect.Field.setAccessible(Field.java:177)
at org.eclipse.serializer.reflect.XReflect.setAccessible(XReflect.java:110)
...
这表明应用程序正在尝试通过反射访问内部类,但 Java 模块系统阻止了这一操作。
我尝试过的:
-
--add-opens
在构建时添加:在我的中
pom.xml
,我包含了以下构建参数:<buildArgs> <buildArg>--add-opens=java.base/java.util=ALL-UNNAMED</buildArg> </buildArgs>
-
在运行时添加
--add-opens
:更新了构建参数以将选项传递
--add-opens
给运行时:<buildArgs> <buildArg>-H:AdditionalRuntimeOptions=--add-opens=java.base/java.util=ALL-UNNAMED</buildArg> </buildArgs>
-
注册反射提示:
在我的中
RuntimeHints.java
,我注册了内部类:hints.reflection().registerType( TypeReference.of("java.util.Collections$SetFromMap"), builder -> builder.withMembers(MemberCategory.values()) );
-
使用反射配置文件:
创建了一个
reflect-config.json
具有必要配置的文件。
尽管进行了这些尝试,但错误仍然存在。
附加信息:
- GitHub 存储库:
- 相关讨论:
问题:
- 有没有办法正确配置 GraalVM 和 Java 模块系统以允许反射访问
java.util.Collections$SetFromMap
? - 这个问题是否是由于 EclipseStore 与 Java 21 或 GraalVM 21.0.5 之间不兼容造成的?
- 是否有其他方法可以解决此错误而不依赖于内部 JDK 类?
非常感谢任何指导或建议,特别是那些在 GraalVM 方面有经验或在本机映像中使用 Java 模块系统的人。
相关代码:
重大变化是添加 EclipseStore。如果我从 Spring Initializer 下载一个新项目并添加我的控制器,它可以编译为本机映像并运行。一旦我添加 EclipseStore,运行本机映像时就会发生错误。我上面尝试过的任何方法似乎都无法改变结果。
public class EclipseAccountAdapter {
private final EmbeddedStorageManager storageManager;
private static final Logger log = LoggerFactory.getLogger(EclipseAccountAdapter.class);
private final ApplicationContext context;
public EclipseAccountAdapter(EmbeddedStorageManager storageManager, ApplicationContext context) {
this.storageManager = storageManager;
this.context = context;
initializeRoot();
}
private void initializeRoot() {
if (storageManager.root() == null) {
log.info("Initializing root.");
storageManager.setRoot(new DataRoot());
storageManager.storeRoot();
}
}
@Write
public int save(Account account, StorerType storerType) {
getRoot().accounts().add(account);
store(getRoot().accounts().usernameToAccount(), storerType);
return getRoot().accounts().all().size();
}
@Read
public List<Account> findAll() {
return new ArrayList<>(getRoot().accounts().all());
}
private DataRoot getRoot() {
return (DataRoot) storageManager.root();
}
private void store(final Object object, StorerType storerType) {
try {
switch (storerType) {
case LAZY: {
Storer lazyStorer = storageManager.createLazyStorer();
lazyStorer.store(object);
lazyStorer.commit();
break;
}
case EAGER: {
Storer eagerStorer = storageManager.createEagerStorer();
eagerStorer.store(object);
eagerStorer.commit();
}
default:
storageManager.store(object);
}
} catch (final Throwable t) {
onStorageFailure(t);
}
}
private void onStorageFailure(final Throwable t) {
if (storageManager != null && storageManager.isRunning()) {
try {
log.error("Storage error! Shutting down storage...", t);
SpringApplication.exit(context, () -> 0);
} catch (final Throwable throwable) {
log.error(throwable.getMessage(), throwable);
}
}
DataRoot root = getRoot();
if (root != null) {
root.clear();
}
}
}
pom.xml 代码片段:
pom.xml
以下仅包含关键依赖项和GraalVM
构建参数的部分:
<dependencies>
<!-- Spring Boot and GraalVM dependencies -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.store</groupId>
<artifactId>storage-embedded</artifactId>
<version>2.0.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
堆栈跟踪
使用以下命令编译本机映像./mvnw -Pnative -DbuildArgs="-Ob" native:compile -DskipTests
并运行它:
2024-10-27T08:01:30.632-05:00 INFO 19610 --- [nativeImageTest] [ main] d.n.nativeImageTest.ServiceConfig : Initializing EmbeddedStorageManager...
2024-10-27T08:01:30.634-05:00 WARN 19610 --- [nativeImageTest] [ main] w.s.c.ServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'accountController': Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'eclipseAccountAdapter': Unsatisfied dependency expressed through method 'eclipseAccountAdapter' parameter 0: Error creating bean with name 'injectStorageTest': Instantiation of supplied bean failed
2024-10-27T08:01:30.634-05:00 INFO 19610 --- [nativeImageTest] [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'accountController': Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'eclipseAccountAdapter': Unsatisfied dependency expressed through method 'eclipseAccountAdapter' parameter 0: Error creating bean with name 'injectStorageTest': Instantiation of supplied bean failed
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'eclipseAccountAdapter': Unsatisfied dependency expressed through method 'eclipseAccountAdapter' parameter 0: Error creating bean with name 'injectStorageTest': Instantiation of supplied bean failed
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'injectStorageTest': Instantiation of supplied bean failed
Caused by: org.eclipse.serializer.exceptions.NoSuchNestedClassRuntimeException: No nested class java.util.Collections$SetFromMap found in class java.util.Collections
at org.eclipse.serializer.reflect.XReflect.getDeclaredNestedClass(XReflect.java:416)
at org.eclipse.serializer.persistence.binary.java.util.BinaryHandlerSetFromMap.New(BinaryHandlerSetFromMap.java:39)
注意:我查看了类似的问题和文档,但尚未找到有效的解决方案。如果有人遇到过类似的问题或知道如何解决此问题,您的帮助将非常宝贵。
20
最佳答案
1
您遇到的问题不是来自 EclipseStore,而是实际上来自()(而且还有一些 Eclipse Store 类如何与 Eclipse 序列化器一起使用)。
实际上,正如您已经注意到的,您面临两类问题:允许深度反射访问Collections.SetFromMap#m
和提供反射提示。
你--add-opens
已经工作了
您的尝试 1 应该已经解决了反射访问的问题:
<buildArgs>
<buildArg>--add-opens=java.base/java.util=ALL-UNNAMED</buildArg>
</buildArgs>
在测试中使用代理
对于反射提示,您可以使用代理(您已经尝试过)。由于您已经有测试,因此您只需使用 运行这些测试即可-agentlib:native-image-agent=config-output-dir=/path/to/your/suggested/agent/output
。您可以通过将该参数临时添加到maven-surefire-plugin
并运行来做到这一点mvn test
:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.0</version>
<configuration>
<!-- TODO replace the path with the actual path you want -->
<argLine>--add-opens java.base/java.util=ALL-UNNAMED -agentlib:native-image-agent=config-output-dir=/path/to/your/suggested/agent/output</argLine>
<forkCount>1</forkCount>
</configuration>
</plugin>
这应该会创建一个目录/path/to/your/suggested/agent/output
,其中包含一个reflect-config.json
文件,其中包含使用测试反射访问的所有内容。然后,您可以将该文件复制到项目中,并在构建本机可执行文件时使用它。请注意,您只需生成该文件一次(或者,如果您更新该库并遇到类似问题,则可能需要重新创建它),而不是每次要构建可执行文件时都生成。您可以在pom.xml
之后删除或注释掉该部分(或使用<profile>
for 它)。
假设您将该文件复制到native-image-config/reflect-config.json
,则可以添加-H:ReflectionConfigurationFiles=native-image-config/reflect-config.json
参数native-image
:
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<configuration>
<buildArgs>
<buildArg>--add-opens java.base/java.util=ALL-UNNAMED</buildArg>
<buildArg>-H:ReflectionConfigurationFiles=native-image-config/reflect-config.json</buildArg>
</buildArgs>
</configuration>
</plugin>
正确修复反射提示
为了使库与 native-image 兼容,这些提示应该作为库的一部分添加,或者添加到中。为此,您可能需要在项目(Eclipse 序列化程序)的问题跟踪器中创建一个问题,并要求他们将其添加到他们的 JAR 或可达性元数据存储库中。如果您包含reflect-config.json
从运行代理中获得的信息,可能会有所帮助。但是,在这样做时,请使用 Eclipse 序列化程序在项目上运行代理,不要使用其他任何东西,尤其是在没有 Spring 的情况下(或者使用代理运行 Eclipse 序列化程序测试并收集其输出)。
如果 Eclipse 序列化器捆绑了反射提示或者在可达性元数据存储库中提供了这些提示,其他人应该能够使用它而不需要自己配置所有内容。
清理reflect-config.json
由于 Spring 和许多其他东西(已经提供提示)都在使用反射,因此您的reflect-config.json
还包含许多您不需要再次指定的内容。您可以尝试reflect-config.json
通过删除与 Eclipse Store 或 Eclipse Serializer 无关的所有内容并保留来减少java.util.Collections$SetFromMap
。当我这样做时,文件只剩下 97 个条目,而之前有 1205 个条目。
就我而言,清理后的reflect-config.json
效果如下:
[
{
"name":"java.util.Collections$SetFromMap",
"allDeclaredFields":true,
"queryAllDeclaredMethods":true
},
{
"name":"[Lorg.eclipse.serializer.persistence.binary.types.BinaryField;"
},
{
"name":"[Lorg.eclipse.serializer.persistence.binary.types.BinaryReferenceTraverser;"
},
{
"name":"[Lorg.eclipse.serializer.persistence.binary.types.LoadItemsChain$Entry;"
},
{
"name":"[Lorg.eclipse.serializer.persistence.types.PersistenceTypeDefinitionMemberFieldGeneric;"
},
{
"name":"[Lorg.eclipse.serializer.persistence.types.PersistenceTypeDescription;"
},
{
"name":"[Lorg.eclipse.store.afs.nio.types.NioReadableFile$Default;"
},
{
"name":"org.eclipse.serializer.collections.BulkList",
"queryAllDeclaredMethods":true
},
{
"name":"org.eclipse.serializer.collections.ConstHashEnum",
"queryAllDeclaredMethods":true
},
{
"name":"org.eclipse.serializer.collections.ConstHashTable",
"allDeclaredFields":true,
"queryAllDeclaredMethods":true
},
{
"name":"org.eclipse.serializer.collections.ConstHashTable$Keys"
},
{
"name":"org.eclipse.serializer.collections.ConstHashTable$Values"
},
{
"name":"org.eclipse.serializer.collections.ConstList",
"queryAllDeclaredMethods":true
},
{
"name":"org.eclipse.serializer.collections.Empty",
"allDeclaredFields":true,
"queryAllDeclaredMethods":true,
"unsafeAllocated":true
},
{
"name":"org.eclipse.serializer.collections.EmptyTable",
"allDeclaredFields":true,
"queryAllDeclaredMethods":true,
"unsafeAllocated":true
},
{
"name":"org.eclipse.serializer.collections.EmptyTable$Keys",
"allDeclaredFields":true,
"queryAllDeclaredMethods":true,
"unsafeAllocated":true
},
{
"name":"org.eclipse.serializer.collections.EmptyTable$Values",
"allDeclaredFields":true,
"queryAllDeclaredMethods":true,
"unsafeAllocated":true
},
{
"name":"org.eclipse.serializer.collections.EqBulkList",
"allDeclaredFields":true,
"queryAllDeclaredMethods":true
},
{
"name":"org.eclipse.serializer.collections.EqConstHashEnum",
"allDeclaredFields":true,
"queryAllDeclaredMethods":true
},
{
"name":"org.eclipse.serializer.collections.EqConstHashTable",
"allDeclaredFields":true,
"queryAllDeclaredMethods":true
},
{
"name":"org.eclipse.serializer.collections.EqConstHashTable$Keys"
},
{
"name":"org.eclipse.serializer.collections.EqConstHashTable$Values"
},
{
"name":"org.eclipse.serializer.collections.EqHashEnum",
"allDeclaredFields":true,
"queryAllDeclaredMethods":true
},
{
"name":"org.eclipse.serializer.collections.EqHashTable",
"queryAllDeclaredMethods":true
},
{
"name":"org.eclipse.serializer.collections.EqHashTable$Keys"
},
{
"name":"org.eclipse.serializer.collections.EqHashTable$Values"
},
{
"name":"org.eclipse.serializer.collections.FixedList",
"queryAllDeclaredMethods":true
},
{
"name":"org.eclipse.serializer.collections.HashEnum",
"queryAllDeclaredMethods":true
},
{
"name":"org.eclipse.serializer.collections.HashTable",
"queryAllDeclaredMethods":true
},
{
"name":"org.eclipse.serializer.collections.HashTable$Keys"
},
{
"name":"org.eclipse.serializer.collections.HashTable$Values"
},
{
"name":"org.eclipse.serializer.collections.LimitList",
"queryAllDeclaredMethods":true
},
{
"name":"org.eclipse.serializer.collections.Singleton",
"queryAllDeclaredMethods":true
},
{
"name":"org.eclipse.serializer.collections.lazy.LazyArrayList",
"allDeclaredFields":true,
"queryAllDeclaredMethods":true,
"methods":[{"name":"addSegment","parameterTypes":["int","int","java.lang.Object"] }]
},
{
"name":"org.eclipse.serializer.collections.lazy.LazyArrayList$Segment",
"allDeclaredFields":true,
"methods":[{"name":"cleanModified","parameterTypes":[] }, {"name":"getLazy","parameterTypes":[] }, {"name":"getLazyData","parameterTypes":[] }]
},
{
"name":"org.eclipse.serializer.collections.lazy.LazyHashMap",
"allDeclaredFields":true,
"queryAllDeclaredMethods":true,
"methods":[{"name":"addSegment","parameterTypes":["int","int","int","java.lang.Object"] }]
},
{
"name":"org.eclipse.serializer.collections.lazy.LazyHashMap$LazyHashMapSegmentEntryList",
"queryAllDeclaredMethods":true
},
{
"name":"org.eclipse.serializer.collections.lazy.LazyHashMap$Segment",
"allDeclaredFields":true,
"methods":[{"name":"cleanModified","parameterTypes":[] }, {"name":"getLazy","parameterTypes":[] }, {"name":"getLazyData","parameterTypes":[] }]
},
{
"name":"org.eclipse.serializer.collections.lazy.LazyHashSet",
"allDeclaredFields":true,
"queryAllDeclaredMethods":true
},
{
"name":"org.eclipse.serializer.collections.lazy.LazySegmentUnloader"
},
{
"name":"org.eclipse.serializer.hashing.HashEqualator"
},
{
"name":"org.eclipse.serializer.hashing.XHashing$SingletonIdentityHashEqualator",
"allDeclaredFields":true,
"queryAllDeclaredMethods":true,
"unsafeAllocated":true
},
{
"name":"org.eclipse.serializer.hashing.XHashing$SingletonKeyValueIdentityHashEqualator",
"allDeclaredFields":true,
"queryAllDeclaredMethods":true,
"unsafeAllocated":true
},
{
"name":"org.eclipse.serializer.hashing.XHashing$SingletonValueHashEqualator",
"allDeclaredFields":true,
"queryAllDeclaredMethods":true,
"unsafeAllocated":true
},
{
"name":"org.eclipse.serializer.memory.sun.JdkInternals$ObjectHeaderSizeDummy",
"allDeclaredFields":true
},
{
"name":"org.eclipse.serializer.monitoring.LazyReferenceManagerMonitor",
"queryAllPublicConstructors":true
},
{
"name":"org.eclipse.serializer.monitoring.LazyReferenceManagerMonitorMBean",
"queryAllPublicMethods":true
},
{
"name":"org.eclipse.serializer.monitoring.MonitorDescription",
"queryAllPublicMethods":true,
"methods":[{"name":"value","parameterTypes":[] }]
},
{
"name":"org.eclipse.serializer.persistence.binary.java.net.BinaryHandlerInetSocketAddress",
"allDeclaredFields":true
},
{
"name":"org.eclipse.serializer.persistence.types.PersistenceRootReference$Default",
"queryAllDeclaredMethods":true
},
{
"name":"org.eclipse.serializer.persistence.types.PersistenceRoots$Default",
"queryAllDeclaredMethods":true
},
{
"name":"org.eclipse.serializer.reference.ControlledLazyReference$Default",
"queryAllDeclaredMethods":true,
"methods":[{"name":"<init>","parameterTypes":["java.lang.Object","long","org.eclipse.serializer.reference.ObjectSwizzling"] }]
},
{
"name":"org.eclipse.serializer.reference.Lazy$Default",
"queryAllDeclaredMethods":true,
"methods":[{"name":"<init>","parameterTypes":["java.lang.Object","long","org.eclipse.serializer.reference.ObjectSwizzling"] }]
},
{
"name":"org.eclipse.serializer.reflect.ClassLoaderProvider",
"queryAllDeclaredMethods":true,
"queryAllPublicMethods":true
},
{
"name":"org.eclipse.serializer.util.Substituter$Default",
"queryAllDeclaredMethods":true
},
{
"name":"org.eclipse.store.integrations.spring.boot.types.DefaultEclipseStoreConfiguration",
"allDeclaredFields":true,
"queryAllDeclaredMethods":true,
"methods":[{"name":"<init>","parameterTypes":[] }, {"name":"defaultEclipseStoreProperties","parameterTypes":[] }]
},
{
"name":"org.eclipse.store.integrations.spring.boot.types.DefaultEclipseStoreConfiguration$$SpringCGLIB$$0",
"allDeclaredFields":true,
"queryAllDeclaredMethods":true,
"queryAllDeclaredConstructors":true,
"fields":[{"name":"CGLIB$FACTORY_DATA"}],
"methods":[{"name":"<init>","parameterTypes":[] }, {"name":"CGLIB$SET_STATIC_CALLBACKS","parameterTypes":["org.springframework.cglib.proxy.Callback[]"] }, {"name":"CGLIB$SET_THREAD_CALLBACKS","parameterTypes":["org.springframework.cglib.proxy.Callback[]"] }]
},
{
"name":"org.eclipse.store.integrations.spring.boot.types.DefaultEclipseStoreConfiguration$$SpringCGLIB$$FastClass$$0",
"methods":[{"name":"<init>","parameterTypes":["java.lang.Class"] }]
},
{
"name":"org.eclipse.store.integrations.spring.boot.types.DefaultEclipseStoreConfiguration$$SpringCGLIB$$FastClass$$1",
"methods":[{"name":"<init>","parameterTypes":["java.lang.Class"] }]
},
{
"name":"org.eclipse.store.integrations.spring.boot.types.EclipseStoreSpringBoot",
"allDeclaredFields":true,
"queryAllDeclaredMethods":true,
"methods":[{"name":"<init>","parameterTypes":[] }, {"name":"classLoaderProvider","parameterTypes":["org.springframework.context.ApplicationContext"] }, {"name":"eclipseStoreConfigConverter","parameterTypes":[] }, {"name":"embeddedStorageFoundationFactory","parameterTypes":["org.eclipse.store.integrations.spring.boot.types.converter.EclipseStoreConfigConverter","org.eclipse.serializer.reflect.ClassLoaderProvider"] }, {"name":"embeddedStorageManagerFactory","parameterTypes":[] }]
},
{
"name":"org.eclipse.store.integrations.spring.boot.types.EclipseStoreSpringBoot$$SpringCGLIB$$0",
"allDeclaredFields":true,
"queryAllDeclaredMethods":true,
"queryAllDeclaredConstructors":true,
"fields":[{"name":"CGLIB$FACTORY_DATA"}],
"methods":[{"name":"<init>","parameterTypes":[] }, {"name":"CGLIB$SET_STATIC_CALLBACKS","parameterTypes":["org.springframework.cglib.proxy.Callback[]"] }, {"name":"CGLIB$SET_THREAD_CALLBACKS","parameterTypes":["org.springframework.cglib.proxy.Callback[]"] }]
},
{
"name":"org.eclipse.store.integrations.spring.boot.types.EclipseStoreSpringBoot$$SpringCGLIB$$FastClass$$0",
"methods":[{"name":"<init>","parameterTypes":["java.lang.Class"] }]
},
{
"name":"org.eclipse.store.integrations.spring.boot.types.EclipseStoreSpringBoot$$SpringCGLIB$$FastClass$$1",
"methods":[{"name":"<init>","parameterTypes":["java.lang.Class"] }]
},
{
"name":"org.eclipse.store.integrations.spring.boot.types.concurrent.Read",
"queryAllDeclaredMethods":true
},
{
"name":"org.eclipse.store.integrations.spring.boot.types.concurrent.Write",
"queryAllDeclaredMethods":true
},
{
"name":"org.eclipse.store.integrations.spring.boot.types.configuration.ConfigurationPair"
},
{
"name":"org.eclipse.store.integrations.spring.boot.types.configuration.EclipseStoreProperties",
"allDeclaredFields":true,
"queryAllDeclaredMethods":true,
"methods":[{"name":"<init>","parameterTypes":[] }, {"name":"close","parameterTypes":[] }, {"name":"shutdown","parameterTypes":[] }]
},
{
"name":"org.eclipse.store.integrations.spring.boot.types.configuration.StorageFilesystem"
},
{
"name":"org.eclipse.store.integrations.spring.boot.types.configuration.aws.AbstractAwsProperties"
},
{
"name":"org.eclipse.store.integrations.spring.boot.types.configuration.aws.Aws"
},
{
"name":"org.eclipse.store.integrations.spring.boot.types.configuration.azure.Azure"
},
{
"name":"org.eclipse.store.integrations.spring.boot.types.configuration.oraclecloud.Oraclecloud"
},
{
"name":"org.eclipse.store.integrations.spring.boot.types.configuration.sql.AbstractSqlConfiguration"
},
{
"name":"org.eclipse.store.integrations.spring.boot.types.configuration.sql.Sql"
},
{
"name":"org.eclipse.store.integrations.spring.boot.types.converter.EclipseStoreConfigConverter",
"allDeclaredFields":true,
"queryAllDeclaredMethods":true,
"methods":[{"name":"close","parameterTypes":[] }, {"name":"shutdown","parameterTypes":[] }]
},
{
"name":"org.eclipse.store.integrations.spring.boot.types.factories.EmbeddedStorageFoundationFactory",
"allDeclaredFields":true,
"queryAllDeclaredMethods":true,
"methods":[{"name":"close","parameterTypes":[] }, {"name":"shutdown","parameterTypes":[] }]
},
{
"name":"org.eclipse.store.integrations.spring.boot.types.factories.EmbeddedStorageManagerFactory",
"allDeclaredFields":true,
"queryAllDeclaredMethods":true,
"methods":[{"name":"close","parameterTypes":[] }, {"name":"shutdown","parameterTypes":[] }]
},
{
"name":"org.eclipse.store.integrations.spring.boot.types.suppliers.EmbeddedStorageFoundationSupplier"
},
{
"name":"org.eclipse.store.storage.embedded.configuration.types.EmbeddedStorageConfigurationBuilder"
},
{
"name":"org.eclipse.store.storage.embedded.types.EmbeddedStorageFoundation"
},
{
"name":"org.eclipse.store.storage.embedded.types.EmbeddedStorageManager"
},
{
"name":"org.eclipse.store.storage.embedded.types.EmbeddedStorageManager$Default"
},
{
"name":"org.eclipse.store.storage.monitoring.EntityCacheMonitor",
"queryAllPublicConstructors":true
},
{
"name":"org.eclipse.store.storage.monitoring.EntityCacheMonitorMBean",
"queryAllPublicMethods":true
},
{
"name":"org.eclipse.store.storage.monitoring.EntityCacheSummaryMonitor",
"queryAllPublicConstructors":true
},
{
"name":"org.eclipse.store.storage.monitoring.EntityCacheSummaryMonitorMBean",
"queryAllPublicMethods":true
},
{
"name":"org.eclipse.store.storage.monitoring.ObjectRegistryMonitor",
"queryAllPublicConstructors":true
},
{
"name":"org.eclipse.store.storage.monitoring.ObjectRegistryMonitorMBean",
"queryAllPublicMethods":true
},
{
"name":"org.eclipse.store.storage.monitoring.StorageChannelHousekeepingMonitor",
"queryAllPublicConstructors":true
},
{
"name":"org.eclipse.store.storage.monitoring.StorageChannelHousekeepingMonitorMBean",
"queryAllPublicMethods":true
},
{
"name":"org.eclipse.store.storage.monitoring.StorageManagerMonitor",
"queryAllPublicConstructors":true
},
{
"name":"org.eclipse.store.storage.monitoring.StorageManagerMonitor$ChannelStatistics",
"queryAllPublicMethods":true
},
{
"name":"org.eclipse.store.storage.monitoring.StorageManagerMonitor$FileStatistics",
"queryAllPublicMethods":true
},
{
"name":"org.eclipse.store.storage.monitoring.StorageManagerMonitor$StorageStatistics",
"queryAllPublicMethods":true
},
{
"name":"org.eclipse.store.storage.monitoring.StorageManagerMonitorMXBean",
"queryAllPublicMethods":true
},
{
"name":"org.eclipse.store.storage.types.StorageStructureValidator$Default"
},
{
"name":"org.eclipse.store.storage.types.StorageSystem$Default"
}
]
1
-
谢谢,Dan!我很欣赏您的见解,尤其是关于 Eclipse Serializer 的反射访问限制。我已将您的答案标记为已接受,因为它阐明了后续步骤并帮助我将其识别为兼容性问题,而不是我的设置错误。我现在打开了一个 Eclipse Serializer 的 GitHub 问题来解决这个问题。您的指导对我的前进非常有帮助 — 再次感谢您!
–
|
InaccessibleObjectException
。这是故意的吗?–
--add-opens
)?–
–
java.util.Collections$SetFromMap.m
(使用setAccessible()
而不使用 Spring/EclipseStore 并且与--add-opens java.base/java.util=ALL-UNNAMED
一起[{"name" : "java.util.Collections$SetFromMap", "fields": [{"name" : "m"}]}]
使用reflect-config.json
。–
–
|