-
Notifications
You must be signed in to change notification settings - Fork 120
Open
Description
Previously this was likely to work via reflection:
public void setListener(Binder binder, Listener listener) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
org.glassfish.jaxb.runtime.v2.runtime.BinderImpl binderImpl = (org.glassfish.jaxb.runtime.v2.runtime.BinderImpl )binder;
Method method = binderImpl.getClass().getDeclaredMethod("getUnmarshaller");
method.setAccessible(true);
Unmarshaller u = (Unmarshaller)method.invoke(binderImpl);
u.setListener(listener);
}
Nowadays, the likely outcome is:
java.lang.reflect.InaccessibleObjectException: Unable to make private org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.UnmarshallerImpl org.glassfish.jaxb.runtime.v2.runtime.BinderImpl.getUnmarshaller() accessible: module org.glassfish.jaxb.runtime does not "opens org.glassfish.jaxb.runtime.v2.runtime" to module org.docx4j.JAXB_ReferenceImpl
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:200)
at java.base/java.lang.reflect.Method.setAccessible(Method.java:194)
Metadata
Metadata
Assignees
Labels
No labels