I use the lib doze-core (7.0.0) to map classes that have some fields of type javax.xml.datatype.XMLGregorianCalendar.
the map from my entity to class1 --> the type of filed in my object is com.sun.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl
and for the map from classe1 to class2, I have the error :
Source parent class: class1
Source field name: dateModification
Source field type: class com.sun.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl
Source field value: 2025-02-05T13:25:06.000Z
Dest parent class: class2
Dest field name: dateModification
Dest field type: javax.xml.datatype.XMLGregorianCalendar
java.lang.reflect.InaccessibleObjectException: Unable to make public int com.sun.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl.getYear() accessible: module java.xml does not "exports com.sun.apache.xerces.internal.jaxp.datatype" to unnamed module @624b0e1b
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)
at com.github.dozermapper.core.util.ReflectionUtils.invoke(ReflectionUtils.java:348)
I have already this in jvm argument of apache tomcat 10 (jdk17)
--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED --add-opens=java.xml/com.sun.apache.xerces.internal.jaxp=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED
It works fine in jdk8/ tomcat8 with net.sf.dozer (5.5.1) as the class com.sun.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl was public in jdK8 as I read.
How can I correct this error ?
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744750032a4591540.html
评论列表(0条)