Azure / Azure/azure-functions-java-worker
Upgrading GSON version from 2.9.0 to 2.11.0
- Vorherrschende Sprache
- Java
- Sterne
- 103
- Forks
- 74
- Ø Merge
- 4 T. 8 Std.
- Gemergte PRs (30 T.)
- 2
Beschreibung
**Context**
When we upgraded from GSON 2.9 to 2.11, certain code paths that rely on reflection (especially on Java 17+) began throwing InaccessibleObjectException. This most commonly happens when GSON tries to serialize internal JDK classes or Throwable objects.
**User Workarounds**
- JVM Flag: Add `--add-opens java.base/java.lang.module=ALL-UNNAMED` to the JVM startup parameters.
- Custom TypeAdapter: Write a TypeAdapter for Throwable (or any other internal class) to avoid default reflection.
See this link for more details: https://stackoverflow.com/questions/76778605/inaccessibleobjectexception-while-working-in-gson-2-10-1-with-java-17-and-spring
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.