ProtocolLib

3M Downloads

Java 20

SlimeDog opened this issue · 10 comments

commented
  • This issue is not solved in a development build

Describe the bug
Java 20
Spigot1.19.4-3692 or Paper 1.19.4-466
ProtocolLib 5.0.0-b616

Java 20 has just been released, so early days. Unfortunately, ProtocolLib does not play well with Java 20. Java 19 is fine.

To Reproduce
Steps to reproduce the behavior:

  1. Install Java 20
  2. Start server
  3. See log error

Expected behavior
Java 20 compatibility

Log errors

[08:32:23] [Server thread/INFO]: [ProtocolLib] Loading ProtocolLib v5.0.0-SNAPSHOT-b616
[08:32:23] [Server thread/WARN]: [ProtocolLib] Version (MC: 1.19.4) has not yet been tested! Proceed with caution.
[08:32:24] [Server thread/ERROR]: null initializing ProtocolLib v5.0.0-SNAPSHOT-b616 (Is it up to date?)
java.lang.ExceptionInInitializerError: null
        at com.comphenix.protocol.injector.netty.manager.NetworkManagerInjector.<clinit>(NetworkManagerInjector.java:39) ~[?:?]
        at com.comphenix.protocol.injector.PacketFilterManager.<init>(PacketFilterManager.java:108) ~[?:?]
        at com.comphenix.protocol.injector.PacketFilterBuilder.build(PacketFilterBuilder.java:120) ~[?:?]
        at com.comphenix.protocol.ProtocolLib.onLoad(ProtocolLib.java:175) ~[?:?]
        at org.bukkit.craftbukkit.v1_19_R3.CraftServer.loadPlugins(CraftServer.java:427) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3692-Spigot-6ad4b93-40b87e1]
        at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:219) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3692-Spigot-6ad4b93-40b87e1]
        at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:975) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3692-Spigot-6ad4b93-40b87e1]
        at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3692-Spigot-6ad4b93-40b87e1]
        at java.lang.Thread.run(Thread.java:1623) ~[?:?]
Caused by: java.lang.UnsupportedOperationException: Cannot define class using reflection: Unable to make protected java.lang.Package java.lang.ClassLoader.getPackage(java.lang.String) accessible: module java.base does not "opens java.lang" to unnamed module @22b6b844
        at com.comphenix.net.bytebuddy.dynamic.loading.ClassInjector$UsingReflection$Dispatcher$Initializable$Unavailable.defineClass(ClassInjector.java:472) ~[?:?]
        at com.comphenix.net.bytebuddy.dynamic.loading.ClassInjector$UsingReflection.injectRaw(ClassInjector.java:284) ~[?:?]
        at com.comphenix.net.bytebuddy.dynamic.loading.ClassInjector$AbstractBase.inject(ClassInjector.java:118) ~[?:?]
        at com.comphenix.net.bytebuddy.dynamic.loading.ClassLoadingStrategy$Default$InjectionDispatcher.load(ClassLoadingStrategy.java:241) ~[?:?]
        at com.comphenix.net.bytebuddy.dynamic.loading.ClassLoadingStrategy$Default.load(ClassLoadingStrategy.java:148) ~[?:?]
        at com.comphenix.net.bytebuddy.dynamic.TypeResolutionStrategy$Passive.initialize(TypeResolutionStrategy.java:101) ~[?:?]
        at com.comphenix.net.bytebuddy.dynamic.DynamicType$Default$Unloaded.load(DynamicType.java:6166) ~[?:?]
        at com.comphenix.protocol.injector.temporary.TemporaryPlayerFactory.setupProxyPlayerConstructor(TemporaryPlayerFactory.java:159) ~[?:?]
        at com.comphenix.protocol.injector.temporary.TemporaryPlayerFactory.<clinit>(TemporaryPlayerFactory.java:47) ~[?:?]
        ... 9 more

protocol dump
(https://whitedog.straight8.com/drops/protocollib-dump-2023-03-21_09.11.06.txt)

commented

Not likely. As noted, it's early days. Please post a heads-up issue over there.

commented

That's a Bytebuddy issue and as far as I am aware there is no version with j20 support released yet

commented

Can you try this and provide feedback? raphw/byte-buddy#1396 (comment)

commented

Wouldn't

-Dnet.bytebuddy.experimental=true

require a change to ProtocolLib?

Server start invocation

/usr/local/jdk-20/bin/java -Xms8G -Xmx8G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -Dfile-encoding=UTF-8 -Djava.security.manager=allow -Dnet.bytebuddy.experimental=true -Dlog4j2.formatMsgNoLookups=true -jar server.jar nogui --universe ./UNIVERSE

produces this

[08:16:20] [Server thread/INFO]: [ProtocolLib] Loading server plugin ProtocolLib v5.0.0-SNAPSHOT-b616
[08:16:20] [Server thread/WARN]: [ProtocolLib] Version (MC: 1.19.4) has not yet been tested! Proceed with caution.
[08:16:21] [Server thread/ERROR]: [ProtocolLib] Error initializing plugin 'ProtocolLib-5.0.0-b616.jar' in folder 'plugins' (Is it up to date?)
java.lang.ExceptionInInitializerError: null
        at com.comphenix.protocol.injector.netty.manager.NetworkManagerInjector.<clinit>(NetworkManagerInjector.java:39) ~[ProtocolLib-5.0.0-b616.jar:?]
        at com.comphenix.protocol.injector.PacketFilterManager.<init>(PacketFilterManager.java:108) ~[ProtocolLib-5.0.0-b616.jar:?]
        at com.comphenix.protocol.injector.PacketFilterBuilder.build(PacketFilterBuilder.java:120) ~[ProtocolLib-5.0.0-b616.jar:?]
        at com.comphenix.protocol.ProtocolLib.onLoad(ProtocolLib.java:175) ~[ProtocolLib-5.0.0-b616.jar:?]
        at io.papermc.paper.plugin.storage.ServerPluginProviderStorage.processProvided(ServerPluginProviderStorage.java:59) ~[paper-1.19.4.jar:git-Paper-466]
        at io.papermc.paper.plugin.storage.ServerPluginProviderStorage.processProvided(ServerPluginProviderStorage.java:18) ~[paper-1.19.4.jar:git-Paper-466]
        at io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:36) ~[paper-1.19.4.jar:git-Paper-466]
        at io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:36) ~[paper-1.19.4.jar:git-Paper-466]
        at org.bukkit.craftbukkit.v1_19_R3.CraftServer.loadPlugins(CraftServer.java:423) ~[paper-1.19.4.jar:git-Paper-466]
        at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:273) ~[paper-1.19.4.jar:git-Paper-466]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1103) ~[paper-1.19.4.jar:git-Paper-466]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) ~[paper-1.19.4.jar:git-Paper-466]
        at java.lang.Thread.run(Thread.java:1623) ~[?:?]
Caused by: java.lang.UnsupportedOperationException: Cannot define class using reflection: Unable to make protected java.lang.Package java.lang.ClassLoader.getPackage(java.lang.String) accessible: module java.base does not "opens java.lang" to unnamed module @2ff96e20
        at com.comphenix.net.bytebuddy.dynamic.loading.ClassInjector$UsingReflection$Dispatcher$Initializable$Unavailable.defineClass(ClassInjector.java:472) ~[ProtocolLib-5.0.0-b616.jar:?]
        at com.comphenix.net.bytebuddy.dynamic.loading.ClassInjector$UsingReflection.injectRaw(ClassInjector.java:284) ~[ProtocolLib-5.0.0-b616.jar:?]
        at com.comphenix.net.bytebuddy.dynamic.loading.ClassInjector$AbstractBase.inject(ClassInjector.java:118) ~[ProtocolLib-5.0.0-b616.jar:?]
        at com.comphenix.net.bytebuddy.dynamic.loading.ClassLoadingStrategy$Default$InjectionDispatcher.load(ClassLoadingStrategy.java:241) ~[ProtocolLib-5.0.0-b616.jar:?]
        at com.comphenix.net.bytebuddy.dynamic.loading.ClassLoadingStrategy$Default.load(ClassLoadingStrategy.java:148) ~[ProtocolLib-5.0.0-b616.jar:?]
        at com.comphenix.net.bytebuddy.dynamic.TypeResolutionStrategy$Passive.initialize(TypeResolutionStrategy.java:101) ~[ProtocolLib-5.0.0-b616.jar:?]
        at com.comphenix.net.bytebuddy.dynamic.DynamicType$Default$Unloaded.load(DynamicType.java:6166) ~[ProtocolLib-5.0.0-b616.jar:?]
        at com.comphenix.protocol.injector.temporary.TemporaryPlayerFactory.setupProxyPlayerConstructor(TemporaryPlayerFactory.java:159) ~[ProtocolLib-5.0.0-b616.jar:?]
        at com.comphenix.protocol.injector.temporary.TemporaryPlayerFactory.<clinit>(TemporaryPlayerFactory.java:47) ~[ProtocolLib-5.0.0-b616.jar:?]
        ... 13 more

I can wait for the "proper support coming soon." Thanks.

commented

Same here on Java 20.

[11:56:14] [Server thread/ERROR]: [ProtocolLib] Error initializing plugin 'ProtocolLib.jar' in folder 'plugins' (Is it up to date?)
java.lang.ExceptionInInitializerError: null
	at com.comphenix.protocol.injector.netty.manager.NetworkManagerInjector.<clinit>(NetworkManagerInjector.java:39) ~[ProtocolLib.jar:?]
	at com.comphenix.protocol.injector.PacketFilterManager.<init>(PacketFilterManager.java:108) ~[ProtocolLib.jar:?]
	at com.comphenix.protocol.injector.PacketFilterBuilder.build(PacketFilterBuilder.java:120) ~[ProtocolLib.jar:?]
	at com.comphenix.protocol.ProtocolLib.onLoad(ProtocolLib.java:175) ~[ProtocolLib.jar:?]
	at io.papermc.paper.plugin.storage.ServerPluginProviderStorage.processProvided(ServerPluginProviderStorage.java:59) ~[paper-1.19.3.jar:git-Paper-448]
	at io.papermc.paper.plugin.storage.ServerPluginProviderStorage.processProvided(ServerPluginProviderStorage.java:18) ~[paper-1.19.3.jar:git-Paper-448]
	at io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:36) ~[paper-1.19.3.jar:git-Paper-448]
	at io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:36) ~[paper-1.19.3.jar:git-Paper-448]
	at org.bukkit.craftbukkit.v1_19_R2.CraftServer.loadPlugins(CraftServer.java:428) ~[paper-1.19.3.jar:git-Paper-448]
	at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:273) ~[paper-1.19.3.jar:git-Paper-448]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1101) ~[paper-1.19.3.jar:git-Paper-448]
	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[paper-1.19.3.jar:git-Paper-448]
	at java.lang.Thread.run(Thread.java:1623) ~[?:?]
Caused by: java.lang.UnsupportedOperationException: Cannot define class using reflection: Unable to make protected java.lang.Package java.lang.ClassLoader.getPackage(java.lang.String) accessible: module java.base does not "opens java.lang" to unnamed module @66f99c7
	at com.comphenix.net.bytebuddy.dynamic.loading.ClassInjector$UsingReflection$Dispatcher$Initializable$Unavailable.defineClass(ClassInjector.java:472) ~[ProtocolLib.jar:?]
	at com.comphenix.net.bytebuddy.dynamic.loading.ClassInjector$UsingReflection.injectRaw(ClassInjector.java:284) ~[ProtocolLib.jar:?]
	at com.comphenix.net.bytebuddy.dynamic.loading.ClassInjector$AbstractBase.inject(ClassInjector.java:118) ~[ProtocolLib.jar:?]
	at com.comphenix.net.bytebuddy.dynamic.loading.ClassLoadingStrategy$Default$InjectionDispatcher.load(ClassLoadingStrategy.java:241) ~[ProtocolLib.jar:?]
	at com.comphenix.net.bytebuddy.dynamic.loading.ClassLoadingStrategy$Default.load(ClassLoadingStrategy.java:148) ~[ProtocolLib.jar:?]
	at com.comphenix.net.bytebuddy.dynamic.TypeResolutionStrategy$Passive.initialize(TypeResolutionStrategy.java:101) ~[ProtocolLib.jar:?]
	at com.comphenix.net.bytebuddy.dynamic.DynamicType$Default$Unloaded.load(DynamicType.java:6166) ~[ProtocolLib.jar:?]
	at com.comphenix.protocol.injector.temporary.TemporaryPlayerFactory.setupProxyPlayerConstructor(TemporaryPlayerFactory.java:159) ~[ProtocolLib.jar:?]
	at com.comphenix.protocol.injector.temporary.TemporaryPlayerFactory.<clinit>(TemporaryPlayerFactory.java:47) ~[ProtocolLib.jar:?]
	... 13 more
commented

[01:06:32] [Server thread/INFO]: [ProtocolLib] Loading ProtocolLib v5.0.0-SNAPSHOT-b617
[01:06:33] [Server thread/ERROR]: null initializing ProtocolLib v5.0.0-SNAPSHOT-b617 (Is it up to date?)
java.lang.ExceptionInInitializerError: null
at com.comphenix.protocol.injector.netty.manager.NetworkManagerInjector.(NetworkManagerInjector.java:39) ~[?:?]
at com.comphenix.protocol.injector.PacketFilterManager.(PacketFilterManager.java:108) ~[?:?]
at com.comphenix.protocol.injector.PacketFilterBuilder.build(PacketFilterBuilder.java:120) ~[?:?]
at com.comphenix.protocol.ProtocolLib.onLoad(ProtocolLib.java:175) ~[?:?]
at org.bukkit.craftbukkit.v1_19_R3.CraftServer.loadPlugins(CraftServer.java:427) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3693-Spigot-6ad4b93-388d458]
at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:219) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3693-Spigot-6ad4b93-388d458]
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:975) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3693-Spigot-6ad4b93-388d458]
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3693-Spigot-6ad4b93-388d458]
at java.lang.Thread.run(Thread.java:1623) ~[?:?]
Caused by: java.lang.UnsupportedOperationException: Cannot define class using reflection: Unable to make protected java.lang.Package java.lang.ClassLoader.getPackage(java.lang.String) accessible: module java.base does not "opens java.lang" to unnamed module @152605eb
at com.comphenix.net.bytebuddy.dynamic.loading.ClassInjector$UsingReflection$Dispatcher$Initializable$Unavailable.defineClass(ClassInjector.java:472) ~[?:?]
at com.comphenix.net.bytebuddy.dynamic.loading.ClassInjector$UsingReflection.injectRaw(ClassInjector.java:284) ~[?:?]
at com.comphenix.net.bytebuddy.dynamic.loading.ClassInjector$AbstractBase.inject(ClassInjector.java:118) ~[?:?]
at com.comphenix.net.bytebuddy.dynamic.loading.ClassLoadingStrategy$Default$InjectionDispatcher.load(ClassLoadingStrategy.java:241) ~[?:?]
at com.comphenix.net.bytebuddy.dynamic.loading.ClassLoadingStrategy$Default.load(ClassLoadingStrategy.java:148) ~[?:?]
at com.comphenix.net.bytebuddy.dynamic.TypeResolutionStrategy$Passive.initialize(TypeResolutionStrategy.java:101) ~[?:?]
at com.comphenix.net.bytebuddy.dynamic.DynamicType$Default$Unloaded.load(DynamicType.java:6166) ~[?:?]
at com.comphenix.protocol.injector.temporary.TemporaryPlayerFactory.setupProxyPlayerConstructor(TemporaryPlayerFactory.java:159) ~[?:?]
at com.comphenix.protocol.injector.temporary.TemporaryPlayerFactory.(TemporaryPlayerFactory.java:47) ~[?:?]
... 9 more

commented

Confirmed fixed.
Thank you @dmulloy2 !

commented

ProtocolLib 5.0.0-SNAPSHOT-b626 looks great on Paper 1.19.4-477 and Spigot 1.19.4-3699 with Java 20. Thanks.

commented

FWIW, ByteBuddy was update to 1.14.3 earlier today.

commented

FWIW, ByteBuddy was update to 1.14.3 earlier today.

yup, that's what we were waiting on