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

Fix for #45 - module java.xml does not opens X to unnamed module (Java 17) #46

Merged
merged 1 commit into from
May 25, 2022

Conversation

Gems
Copy link
Contributor

@Gems Gems commented Mar 30, 2022

Original cause

Module java.xml does not "opens com.sun.org.apache.xerces.internal.jaxp.datatype" to unnamed module.

Solution

Registering XMLGregorianCalendarAdapter as TypeHierarchyAdapter for XMLGregorianCalendar class

Symptoms

The following exceptions appeared before the fix:

  • (gson:2.8.9 — default) — java.lang.reflect.InaccessibleObjectException: Unable to make public com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl() accessible: module java.xml does not "exports com.sun.org.apache.xerces.internal.jaxp.datatype" to unnamed module
  • (gson:2.9.0 — explicitly added dependency) — com.google.gson.JsonIOException: Failed making field 'com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl#eon' accessible; either change its visibility or write a custom TypeAdapter for its declaring type
  • (gson:2.9.0 — explicitly added dependency) — java.lang.reflect.InaccessibleObjectException: Unable to make field private java.math.BigInteger com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl.eon accessible: module java.xml does not "opens com.sun.org.apache.xerces.internal.jaxp.datatype" to unnamed module

Additional Info

No adding dependency for javax.xml.bind:jaxb-api and com.sun.xml.bind:jaxb-impl required to fix the mentioned problems.

@Gems Gems force-pushed the fix/java17-gson-complatibility branch from 0296682 to 5204cb7 Compare March 30, 2022 13:48
Original cause: module java.xml does not "opens com.sun.org.apache.xerces.internal.jaxp.datatype" to unnamed module

Solution: registering XMLGregorianCalendarAdapter as TypeHierarchyAdapter for XMLGregorianCalendar class
@Gems Gems force-pushed the fix/java17-gson-complatibility branch from 5204cb7 to 8a9f092 Compare March 30, 2022 13:52
@zubri zubri merged commit a04ef69 into prowide:develop May 25, 2022
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

Successfully merging this pull request may close these issues.

2 participants