Initialization Error when Launching SpongeForge with Java 21: InaccessibleObjectException #4173
Labels
status: needs triage
This label is automatically applied to new issues and pull requests to indicate they require triage
type: bug
Something isn't working
Affected Product(s)
SpongeForge
Version
spongeforge-1.21.1-52.0.3-12.0.0-universal.jar
Operating System
Windows 11 24H2
Java Version
Java version: 21.0.6+7-LTS (Eclipse Adoptium OpenJDK)
Plugins/Mods
Without plugins, and i have only sponge in mods.
Describe the bug
Bug Description: When launching a server with the SpongeForge mod version 1.21.1-52.0.3-12.0.0 for Minecraft 1.21.1 and Java 21, an InaccessibleObjectException occurs related to an attempt to access private fields in the Caffeine library. This prevents the server from starting. Additionally, there are warnings about deprecated package scanning and configuration file conflicts.
Steps to Reproduce:
Expected Behavior: The server should start without errors, and the plugins should load correctly.
Actual Behavior: The server fails to start due to the InaccessibleObjectException.
Error in the Log:
WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release
WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release
WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release
WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release
[00:22:50] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher running: args [--launchTarget, forge_server, nogui]
[00:22:50] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: JVM identified as Eclipse Adoptium OpenJDK 64-Bit Server VM 21.0.6+7-LTS
[00:22:50] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher 10.2.4 starting: java version 21.0.6 by Eclipse Adoptium; OS Windows 11 arch amd64 version 10.0
Ignoring duplicate module on SecureModuleFinder: spongeforge.services: Jar[jar:file:///C:/Users/EyeCrasher07/Desktop/sponge/mods/spongeforge-1.21.1-52.0.3-12.0.0-universal.jar!/]
Ignoring duplicate module on SecureModuleFinder: spongeforge.services: Jar[jar:file:///C:/Users/EyeCrasher07/Desktop/sponge/mods/spongeforge-1.21.1-52.0.3-12.0.0-universal.jar!/]
[00:22:50] [main/INFO] [ne.mi.fm.lo.ImmediateWindowHandler/]: ImmediateWindowProvider not loading because launch target is forge_server
[00:22:50] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.7 Source=jar:file:///C:/Users/EyeCrasher07/Desktop/sponge/libraries/org/spongepowered/mixin/0.8.7/mixin-0.8.7.jar!/ Service=ModLauncher Env=SERVER
[00:22:50] [main/INFO] [or.sp.li.LibraryManager/]: Scanning and verifying libraries in '.\sponge-libraries'. Please wait, this may take a moment...
[00:22:51] [main/INFO] [ne.mi.fm.lo.mo.JarInJarDependencyLocator/]: Found 1 dependencies adding them to mods collection
[00:22:52] [main/INFO] [mixin/]: Compatibility level set to JAVA_18
[00:22:52] [main/INFO] [cp.mo.mo.LaunchServiceHandler/MODLAUNCHER]: Launching target 'forge_server' with arguments [nogui]
[00:22:54] [main/INFO] [MixinExtras|Service/]: Initializing MixinExtras via com.llamalad7.mixinextras.service.MixinExtrasServiceImpl(version=0.4.1).
[00:22:54] [main/WARN] [os.ut.FileUtil/]: Configuration conflict: there is more than one oshi.properties file on the classpath: [jar:file:///C:/Users/EyeCrasher07/Desktop/sponge/libraries/com/github/oshi/oshi-core/6.4.10/oshi-core-6.4.10.jar!/oshi.properties, jar:file:/C:/Users/EyeCrasher07/Desktop/sponge/libraries/com/github/oshi/oshi-core/6.4.10/oshi-core-6.4.10.jar!/oshi.properties, jar:file:///C:/Users/EyeCrasher07/Desktop/sponge/libraries/com/github/oshi/oshi-core/6.4.10/oshi-core-6.4.10.jar!/oshi.properties, jar:file:/C:/Users/EyeCrasher07/Desktop/sponge/libraries/com/github/oshi/oshi-core/6.4.10/oshi-core-6.4.10.jar!/oshi.properties]
[00:22:55] [main/WARN] [os.ut.FileUtil/]: Configuration conflict: there is more than one oshi.architecture.properties file on the classpath: [jar:file:///C:/Users/EyeCrasher07/Desktop/sponge/libraries/com/github/oshi/oshi-core/6.4.10/oshi-core-6.4.10.jar!/oshi.architecture.properties, jar:file:/C:/Users/EyeCrasher07/Desktop/sponge/libraries/com/github/oshi/oshi-core/6.4.10/oshi-core-6.4.10.jar!/oshi.architecture.properties, jar:file:///C:/Users/EyeCrasher07/Desktop/sponge/libraries/com/github/oshi/oshi-core/6.4.10/oshi-core-6.4.10.jar!/oshi.architecture.properties, jar:file:/C:/Users/EyeCrasher07/Desktop/sponge/libraries/com/github/oshi/oshi-core/6.4.10/oshi-core-6.4.10.jar!/oshi.architecture.properties]
Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at net.minecraftforge.bootstrap.shim.Main.main(Main.java:101)
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at net.minecraftforge.bootstrap.Bootstrap.bootstrapMain(Bootstrap.java:133)
at net.minecraftforge.bootstrap.Bootstrap.start(Bootstrap.java:53)
at net.minecraftforge.bootstrap.ForgeBootstrap.main(ForgeBootstrap.java:19)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
... 2 more
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at SECURE-BOOTSTRAP/[email protected]/net.minecraftforge.fml.loading.targets.CommonLaunchHandler.runTarget(CommonLaunchHandler.java:85)
at SECURE-BOOTSTRAP/[email protected]/net.minecraftforge.fml.loading.targets.CommonLaunchHandler.lambda$makeService$0(CommonLaunchHandler.java:69)
at SECURE-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:77)
at SECURE-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:97)
at SECURE-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.run(Launcher.java:116)
at SECURE-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.main(Launcher.java:75)
at SECURE-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapEntry.main(BootstrapEntry.java:17)
at [email protected]/net.minecraftforge.bootstrap.Bootstrap.moduleMain(Bootstrap.java:188)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
... 7 more
Caused by: java.lang.ExceptionInInitializerError
at TRANSFORMER/[email protected]/org.spongepowered.forge.launch.inject.SpongeForgeModule.lambda$configure$0(SpongeForgeModule.java:41)
at TRANSFORMER/[email protected]/com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:86)
at TRANSFORMER/[email protected]/com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:57)
at TRANSFORMER/[email protected]/com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:60)
at TRANSFORMER/[email protected]/com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:47)
at TRANSFORMER/[email protected]/com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:41)
at TRANSFORMER/[email protected]/com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:63)
at TRANSFORMER/[email protected]/com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:113)
at TRANSFORMER/[email protected]/com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
at TRANSFORMER/[email protected]/com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:296)
at TRANSFORMER/[email protected]/com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at TRANSFORMER/[email protected]/com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:169)
at TRANSFORMER/[email protected]/com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:39)
at TRANSFORMER/[email protected]/com.google.inject.internal.SingleFieldInjector.inject(SingleFieldInjector.java:51)
at TRANSFORMER/[email protected]/com.google.inject.internal.InjectionRequestProcessor$StaticInjection.injectMembers(InjectionRequestProcessor.java:139)
at TRANSFORMER/[email protected]/com.google.inject.internal.InjectionRequestProcessor.injectMembers(InjectionRequestProcessor.java:94)
at TRANSFORMER/[email protected]/com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:177)
at TRANSFORMER/[email protected]/com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:113)
at TRANSFORMER/[email protected]/com.google.inject.Guice.createInjector(Guice.java:87)
at TRANSFORMER/[email protected]/org.spongepowered.forge.launch.ForgeLaunch.createInjector(ForgeLaunch.java:76)
at TRANSFORMER/[email protected]/net.minecraft.server.Bootstrap.handler$spongeforge$bce000$forge$startLifecycle(Bootstrap.java:556)
at TRANSFORMER/[email protected]/net.minecraft.server.Bootstrap.bootStrap(Bootstrap.java)
at TRANSFORMER/[email protected]/net.minecraft.server.Main.main(Main.java:123)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
... 17 more
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field final com.github.benmanes.caffeine.cache.UnboundedLocalCache com.github.benmanes.caffeine.cache.UnboundedLocalCache$UnboundedLocalManualCache.cache accessible: module com.github.benmanes.caffeine does not "opens com.github.benmanes.caffeine.cache" to module spongeforge
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.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:315)
at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:183)
at java.base/java.lang.reflect.Field.setAccessible(Field.java:177)
at TRANSFORMER/[email protected]/org.spongepowered.common.event.manager.SpongeEventManager.(SpongeEventManager.java:111)
at TRANSFORMER/[email protected]/org.spongepowered.forge.launch.event.ForgeEventManager.(ForgeEventManager.java:50)
at TRANSFORMER/[email protected]/net.minecraftforge.common.MinecraftForge.redirect$spongeforge$bbo000$forge$substituteForgeEventBus(MinecraftForge.java:543)
at TRANSFORMER/[email protected]/net.minecraftforge.common.MinecraftForge.(MinecraftForge.java:40)
... 41 more
Press any key to continue . . .
Link to logs
No response
The text was updated successfully, but these errors were encountered: