magro / kryo-serializers

More kryo serializers
Apache License 2.0
381 stars 120 forks source link

Could not access source collection field in java.util.Collections$UnmodifiableCollection #138

Open amy-b-cheng opened 6 months ago

amy-b-cheng commented 6 months ago

My application was previously using JDK 11, kryo 5.5.0, and kryo-serializers 0.45.

When I upgrade to JDK 21, I'm getting the following error: java.lang.RuntimeException: Could not access source collection field in java.util.Collections$UnmodifiableCollection. at de.javakaffee.kryoserializers.UnmodifiableCollectionsSerializer.<clinit>(UnmodifiableCollectionsSerializer.java:62) and java.lang.reflect.InaccessibleObjectException: Unable to make field final java.util.Collection java.util.Collections$UnmodifiableCollection.c accessible: module java.base does not "opens java.util" to unnamed module @18acfe88

Is this a known problem with JDK 21?