I encountered a JsonIOException while using the PlayerBalancer plugin on the Waterfall server version 1.20-562. This issue occurred on a system running Windows 10 with JDK 21.
Steps to Reproduce
Use Waterfall 1.20-562 on Windows 10 and JDK 21.
Make sure using PlayerBalancer-2.3.5.
Also install BungeeGuard1.3.3, PartyandFriendsAddon-2.3.5 and partyandfriends1.0.240-E plugin.
Start the Waterfall server.
Make sure your backend server is on and reachable.
Observe the error in the server console/logs.
Expected Behavior
The PlayerBalancer plugin should function without any serialization/deserialization issues.
Actual Behavior
The server logs show a JsonIOException related to the Gson library's handling of a private field in the java.awt.Color class. Here is the detailed error message:
[04:17:27 ERROR]: Task BungeeTask(sched=net.md_5.bungee.scheduler.BungeeScheduler@5633dafd, id=59818, owner=com.jaimemartz.playerbalancer.PlayerBalancer@3d9f0a5, task=com.jaimemartz.playerbalancer.ping.PingTactic$1$$Lambda/0x000002044744a960@6c5558a6, delay=0, period=0, running=true) encountered an exception
com.google.gson.JsonIOException: Failed making field 'java.awt.Color#value' accessible; either increase its visibility or write a custom TypeAdapter for its declaring type.
...
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field int java.awt.Color.value accessible: module java.desktop does not "opens java.awt" to unnamed module @33cb5951
...
Environment
Server Software: Waterfall version 1.20-562
Operating System: Windows 10
Java Version: JDK 21
Additional Context
I ask ChatGPT4 for help with the log, and it tells me that this issue seems to be related to Java's module system introduced in Java 9, which enforces strong encapsulation. Gson appears to be unable to access a private field in a core Java class due to these module system rules.
I will attach the full log and the conf of PlayerBalance.
latest.log.txtplugin.conf.txt
Issue Description
I encountered a
JsonIOException
while using the PlayerBalancer plugin on the Waterfall server version 1.20-562. This issue occurred on a system running Windows 10 with JDK 21.Steps to Reproduce
Expected Behavior
The PlayerBalancer plugin should function without any serialization/deserialization issues.
Actual Behavior
The server logs show a
JsonIOException
related to the Gson library's handling of a private field in thejava.awt.Color
class. Here is the detailed error message:Environment
Additional Context
I ask ChatGPT4 for help with the log, and it tells me that this issue seems to be related to Java's module system introduced in Java 9, which enforces strong encapsulation. Gson appears to be unable to access a private field in a core Java class due to these module system rules. I will attach the full log and the conf of PlayerBalance. latest.log.txt plugin.conf.txt
GPT4's answer