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
The error i'm observing is the below shared one, and it's coming up when there are any shapes in the document. I see CTWordprocessingShape and org.eclipse.persistence.internal.oxm.Root are different classes to be cast and code is breaking in below line of AbstractMarshalRecordImpl.
Exception in thread "main" java.lang.ClassCastException: class org.docx4j.com.microsoft.schemas.office.word.x2010.wordprocessingShape.CTWordprocessingShape cannot be cast to class org.eclipse.persistence.internal.oxm.Root (org.docx4j.com.microsoft.schemas.office.word.x2010.wordprocessingShape.CTWordprocessingShape and org.eclipse.persistence.internal.oxm.Root are in unnamed module of loader 'app')
at org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecordImpl.addXsiTypeAndClassIndicatorIfRequired(AbstractMarshalRecordImpl.java:211)
at org.eclipse.persistence.oxm.record.XMLRecord.addXsiTypeAndClassIndicatorIfRequired(XMLRecord.java:406)
at org.eclipse.persistence.internal.oxm.XMLObjectBuilder.buildIntoNestedRow(XMLObjectBuilder.java:462)
at org.eclipse.persistence.oxm.mappings.XMLAnyCollectionMapping.buildCompositeRow(XMLAnyCollectionMapping.java:683)
at org.eclipse.persistence.oxm.mappings.XMLAnyCollectionMapping.writeFromObjectIntoRow(XMLAnyCollectionMapping.java:554)
at org.eclipse.persistence.internal.oxm.XMLObjectBuilder.writeOutMappings(XMLObjectBuilder.java:349)
at org.eclipse.persistence.internal.oxm.XMLObjectBuilder.buildIntoNestedRow(XMLObjectBuilder.java:465)
at org.eclipse.persistence.internal.oxm.XMLObjectBuilder.buildIntoNestedRow(XMLObjectBuilder.java:445)
at org.eclipse.persistence.oxm.mappings.XMLCompositeObjectMapping.buildCompositeRowForDescriptor(XMLCompositeObjectMapping.java:466)
at org.eclipse.persistence.oxm.mappings.XMLCompositeObjectMapping.buildCompositeRow(XMLCompositeObjectMapping.java:447)
at org.eclipse.persistence.oxm.mappings.XMLCompositeObjectMapping.writeSingleValue(XMLCompositeObjectMapping.java:680)
at org.eclipse.persistence.oxm.mappings.XMLCompositeObjectMapping.writeFromObjectIntoRow(XMLCompositeObjectMapping.java:645)
at org.eclipse.persistence.internal.oxm.XMLObjectBuilder.writeOutMappings(XMLObjectBuilder.java:349)
at org.eclipse.persistence.internal.oxm.XMLObjectBuilder.buildIntoNestedRow(XMLObjectBuilder.java:465)
at org.eclipse.persistence.internal.oxm.XMLObjectBuilder.buildIntoNestedRow(XMLObjectBuilder.java:445)
at org.eclipse.persistence.oxm.mappings.XMLCompositeObjectMapping.buildCompositeRowForDescriptor(XMLCompositeObjectMapping.java:466)
I'm fairly new to library and please let me know if there is any work around to bypass the issue and why this issue is happening.
I tried using ReferenceImpl instead of Moxy, ReferenceImpl doesn't cause the issue.
The text was updated successfully, but these errors were encountered:
plutext
changed the title
DocX4j processing with Moxy is failing for a document with shapes
wml shapes: @XmlAnyElement causes ClassCastException across modules with org.eclipse.persistence.oxm.XMLBinder
Jan 20, 2025
I am trying to read a docx file and replace the author names with a constant string. This is the code in my main function.
pom.xml
The error i'm observing is the below shared one, and it's coming up when there are any shapes in the document. I see CTWordprocessingShape and org.eclipse.persistence.internal.oxm.Root are different classes to be cast and code is breaking in below line of AbstractMarshalRecordImpl.
Root xr = (Root) originalObject;
Link to code for AbstractMarshalRecordImpl:- https://github.com/payara/patched-src-eclipselink/blob/master/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/oxm/record/AbstractMarshalRecordImpl.java
I'm fairly new to library and please let me know if there is any work around to bypass the issue and why this issue is happening.
I tried using ReferenceImpl instead of Moxy, ReferenceImpl doesn't cause the issue.
The text was updated successfully, but these errors were encountered: