Skip to content

sun.misc.Unsafe::objectFieldOffset warning under Java 21 (with JEP 471 backport) in SunUnsafeReflectionProvider #474

Description

@Adagedo

During runtime execution, the application logs a terminal deprecation warning stemming from the internal reflection mechanisms of the XStream dependency (com.thoughtworks.xstream:xstream:1.4.21).
The Java Virtual Machine (JVM) issues this alert because XStream directly invokes internal JDK methods (sun.misc.Unsafe). Although this warning standardizes globally in newer Java editions, our underlying Java 21 runtime build has backported JEP 471 security logs.
The application boots up and operates successfully, but this log message clutters environment traces and indicates long-term breaking change risks.

WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::objectFieldOffset has been called by com.thoughtworks.xstream.converters.reflection.SunUnsafeReflectionProvider (file:/C:/Users/User/.m2/repository/com/thoughtworks/xstream/xstream/1.4.21/xstream-1.4.21.jar)
WARNING: Please consider reporting this to the maintainers of class com.thoughtworks.xstream.converters.reflection.SunUnsafeReflectionProvider
WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions