You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While I am using Java SE / EE for decades, I need to confess that I am a newbie with Java Modules. Kindly begging for help!
I have written some JAXB elements in Java and want to package them as a Java Module using the following module-info declaration:
...
opens ... to jakarta.xml.bind, com.sun.xml.bind;
...
That is working pretty well. I can even remove the to part and it still works. 😄
But what I actually want to write is this, as any JAXB implementation shall be able to reflect (but not anybody):
...
opens ... to jakarta.xml.bind;
...
Unfortunately, what happens is this:
java.lang.reflect.InaccessibleObjectException: Unable to make field private ... accessible: module ... does not "opens ..." to module com.sun.xml.bind
at java.base/java.lang.reflect.AccessibleObject.throwInaccessibleObjectException(AccessibleObject.java:387)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:363)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:311)
at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:180)
at java.base/java.lang.reflect.Field.setAccessible(Field.java:174)
at [email protected]/org.glassfish.jaxb.runtime.v2.runtime.reflect.Accessor$FieldReflection.<init>(Accessor.java:213)
What am I doing wrong?
The text was updated successfully, but these errors were encountered:
Can you share simple reproducer and/or relevant parts of the dependency tree? One needs to figure out what is going on in this method - someone - either API or this piece of code - is not properly passing down the opens declaration
While I am using Java SE / EE for decades, I need to confess that I am a newbie with Java Modules. Kindly begging for help!
I have written some JAXB elements in Java and want to package them as a Java Module using the following
module-info
declaration:That is working pretty well. I can even remove the
to
part and it still works. 😄But what I actually want to write is this, as any JAXB implementation shall be able to reflect (but not anybody):
Unfortunately, what happens is this:
What am I doing wrong?
The text was updated successfully, but these errors were encountered: