Jersey 2.40 + JDK 17 [message #1861456] |
Fri, 13 October 2023 12:44 |
Abhijit Bhatode![Friend of Eclipse Friend](https://www.eclipse.org/donate/web-api/friends_decorator.php?email=abhijit.bhatode%40gmail.com) Messages: 1 Registered: October 2023 |
Junior Member |
|
|
Hello team,
I came across [yasson-dev] Issue with yasson jar in jaxrs-ri-2.27. (eclipse.org). But, we are using Jersey 2.40 with JDK 17.
Below exception is seen with REST service is sending a response:
---------------------------
Caused By: java.lang.IllegalAccessException: class org.eclipse.yasson.internal.model.GetFromGetter cannot access class sun.reflect.annotation.AnnotatedTypeFactory$AnnotatedTypeBaseImpl (in module java.base) because module java.base does not export sun.reflect.annotation to unnamed module @6c0d7c83
at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:392)
at java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:674)
at java.base/java.lang.reflect.Method.invoke(Method.java:560)
at org.eclipse.yasson.internal.model.GetFromGetter.internalGetValue(GetFromGetter.java:28)
-----------------------------
I tried adding below in module-info.java file and adding the compiled class in the root of the JAR containing the JAXB related model classes. But, this did not work.
module mycompanyrest {
opens mycompany.rest.model.policy;
exports mycompany.rest.model.policy;
}
After adding JVM options --add-opens java.base/sun.reflect.annotation=ALL-UNNAMED & --add-exports java.base/sun.reflect.annotation=ALL-UNNAMED
error message changed to
------------------------
Caused By: java.lang.IllegalAccessException: class org.eclipse.yasson.internal.model.GetFromGetter cannot access a member of class sun.reflect.annotation.AnnotatedTypeFactory$AnnotatedTypeBaseImpl (in module java.base) with modifiers "public"
------------------
Thank you for your help in advance.
Regards,
Abhijit
|
|
|
Powered by
FUDForum. Page generated in 0.01384 seconds