Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Illegal reflective access by com.google.gson.internal.reflect.UnsafeReflectionAccessor (/com/google/code/gson/gson/2.8.6/gson-2.8.6.jar) to field java.time.LocalDate.year #1836

Closed
FrederickFrance opened this issue Dec 10, 2020 · 1 comment

Comments

@FrederickFrance
Copy link

Hi

I have this warning message but I don't find the place to trace it and, of course, how to fix that 👍

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.gson.internal.reflect.UnsafeReflectionAccessor (file:/home/fred/.m2/repository/com/google/code/gson/gson/2.8.6/gson-2.8.6.jar) to field java.time.LocalDate.year
WARNING: Please consider reporting this to the maintainers of com.google.gson.internal.reflect.UnsafeReflectionAccessor
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

I don'y know which information I can add.

    <java.version>1.8</java.version>
    <tomcat.version>9.0.37</tomcat.version>

Do not hesitate to ask me any information if my message isn't enough clear

@lyubomyr-shaydariv
Copy link
Contributor

Gson is a Java 6 oriented library. All standard runtime library classes to appear in Java 8 are not supported by Gson out of box. All "simple" data classes of java.time.* are among of those. You should create a custom type adapter to support java.time.LocalDate, and do the same for all the classes you need from that package. See also: #1059, #1807, and please don't forget to close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants