Skip to content

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

@amy-b-cheng

Description

@amy-b-cheng

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions