Hi I am trying to use the Compare Documents sample and it seems to be failing on the creation of a new document step. It produces the difference no problem.
The failing line:
Body newBody = (Body) XmlUtils.unwrap(
XmlUtils.unmarshalString(contentStr));
The exception(please let me know if you need the full stack):
java.lang.Throwable: null
at org.docx4j.jaxb.JaxbValidationEventHandler.handleEvent(JaxbValidationEventHandler.java:186)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:716)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:247)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:242)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:109)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader.childElement(Loader.java:90)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StructureLoader.childElement(StructureLoader.java:247)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:556)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:538)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.SAXConnector.startElement(SAXConnector.java:153)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:380)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2787)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:118)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:243)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:214)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:157)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:125)
at org.docx4j.XmlUtils.unmarshalString(XmlUtils.java:558)
at org.docx4j.XmlUtils.unmarshalString(XmlUtils.java:531)
at com.fhlmc.securitization.bookBuilder.poc.tests.TestCompare.main(TestCompare.java:110)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
2018-02-02 15:21:28.619 INFO [main] o.d.XmlUtils - encountered unexpected content; pre-processing
2018-02-02 15:21:28.619 DEBUG [main] o.d.u.ResourceUtils - docx4j.jaxb.JaxbValidationEventHandler resolved to custom-preprocessor.xslt
2018-02-02 15:21:28.619 DEBUG [main] o.d.u.ResourceUtils - Attempting to load: custom-preprocessor.xslt
2018-02-02 15:21:28.620 DEBUG [main] o.d.u.ResourceUtils - Trying Thread.currentThread().getContextClassLoader()
2018-02-02 15:21:28.623 WARN [main] o.d.u.ResourceUtils - Couldn't get resource: custom-preprocessor.xslt
2018-02-02 15:21:28.623 WARN [main] o.d.u.ResourceUtils - custom-preprocessor.xslt: custom-preprocessor.xslt not found via classloader.
2018-02-02 15:21:28.623 WARN [main] o.d.u.ResourceUtils - Property docx4j.jaxb.JaxbValidationEventHandler resolved to missing resource custom-preprocessor.xslt; using org/docx4j/jaxb/mc-preprocessor.xslt
2018-02-02 15:21:28.624 DEBUG [main] o.d.u.ResourceUtils - Attempting to load: org/docx4j/jaxb/mc-preprocessor.xslt
2018-02-02 15:21:28.641 INFO [main] o.d.XmlUtils - Using org.apache.xalan.transformer.TransformerImpl
2018-02-02 15:21:28.641 INFO [main] o.d.XmlUtils - Working around https://issues.apache.org/jira/browse/XALANJ-2419
method: xml
2018-02-02 15:21:28.654 WARN [main] o.d.j.JaxbValidationEventHandler - [ERROR] : unexpected element (uri:"http://www.topologi.com/2005/Diff-X", local:"ins"). Expected elements are <{http://schemas.openxmlformats.org/wordprocessingml/2006/main}subDoc>,<{http://schemas.openxmlformats.org/wordprocessingml/2006/main}sdt>,<{http://schemas.openxmlformats.org/wordprocessingml/2006/main}permEnd>,<{http://schemas.openxmlformats.org/wordprocessingml/2006/main}permStart>,<{http://schemas.openxmlformats.org/wordprocessingml/2006/main}customXmlMoveFromRangeEnd>,<{http://schemas.openxmlformats.org/wordprocessingml/2006/main}customXmlMoveToRangeStart>,<{http://schemas.openxmlformats.org/wordprocessingml/2006/main}customXmlMoveToRangeEnd>,<{http://schemas.openxmlformats.org/wordprocessingml/2006/main}del>,<{http://schemas.openxmlformats.org/wordprocessingml/2006/main}customXmlInsRangeStart>,<{http://schemas.openxmlformats.org/wordprocessingml/2006/main}commentRangeStart>,<{http://schemas.openxmlformats.org/wordprocessingml/2006/main}moveFromRangeStart>,<{http://schemas.openxmlformats.org/wordprocessingml/2006/main}dir>,<{http://schemas.openxmlformats.org/wordprocessingml/2006/main}pPr>,<{http://schemas.openxmlformats.org/officeDocument/2006/math}oMathPara>,<{http://schemas.openxmlformats.org/wordprocessingml/2006/main}moveFrom>,<{http://schemas.openxmlformats.org/wordprocessingml/2006/main}customXmlDelRangeStart>,<{http://schemas.openxmlformats.org/wordprocessingml/2006/main}customXmlDelRangeEnd>,<{http://schemas.openxmlformats.org/wordprocessingml/2006/main}smartTag>,<{http://schemas.openxmlformats.org/wordprocessingml/2006/main}hyperlink>,<{http://schemas.openxmlformats.org/wordprocessingml/2006/main}moveToRangeEnd>,<{http://schemas.openxmlformats.org/wordprocessingml/2006/main}moveToRangeStart>,<{http://schemas.openxmlformats.org/officeDocument/2006/math}oMath>,<{http://schemas.openxmlformats.org/wordprocessingml/2006/main}moveFromRangeEnd>,<{http://schemas.openxmlformats.org/wordprocessingml/2006/main}bookmarkStart>,<{http://schemas.openxmlformats.org/wordprocessingml/2006/main}customXml>,<{http://schemas.openxmlformats.org/wordprocessingml/2006/main}customXmlInsRangeEnd>,<{http://schemas.openxmlformats.org/wordprocessingml/2006/main}ins>,<{http://schemas.openxmlformats.org/wordprocessingml/2006/main}bdo>,<{http://schemas.openxmlformats.org/wordprocessingml/2006/main}r>,<{http://schemas.openxmlformats.org/wordprocessingml/2006/main}customXmlMoveFromRangeStart>,<{http://schemas.openxmlformats.org/wordprocessingml/2006/main}bookmarkEnd>,<{http://schemas.openxmlformats.org/wordprocessingml/2006/main}commentRangeEnd>,<{http://schemas.openxmlformats.org/wordprocessingml/2006/main}moveTo>,<{http://schemas.openxmlformats.org/wordprocessingml/2006/main}fldSimple>,<{http://schemas.openxmlformats.org/wordprocessingml/2006/main}proofErr>
The xml:
<?xml version="1.0" encoding="utf-8"?><w:body xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:dfx="http://www.topologi.com/2005/Diff-X" xmlns:del="http://www.topologi.com/2005/Diff-X/Delete" xmlns:ins="http://www.topologi.com/2005/Diff-X/Insert" xmlns:cdr="http://schemas.openxmlformats.org/drawingml/2006/chartDrawing" xmlns:odi="http://opendope.org/components" xmlns:odq="http://opendope.org/questions" xmlns:pvml="urn:schemas-microsoft-com:office:powerpoint" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture" xmlns:xvml="urn:schemas-microsoft-com:office:excel" xmlns:lc="http://schemas.openxmlformats.org/drawingml/2006/lockedCanvas" xmlns:xdr="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" xmlns:dsp="http://schemas.microsoft.com/office/drawing/2008/diagram" xmlns:oda="http://opendope.org/answers" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:cppr="http://schemas.microsoft.com/office/2006/coverPageProps" xmlns:comp="http://schemas.openxmlformats.org/drawingml/2006/compatibility" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:sl="http://schemas.openxmlformats.org/schemaLibrary/2006/main" xmlns:wetp="http://schemas.microsoft.com/office/webextensions/taskpanes/2010/11" xmlns:odx="http://opendope.org/xpaths" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:b="http://schemas.openxmlformats.org/officeDocument/2006/bibliography" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:dgm="http://schemas.openxmlformats.org/drawingml/2006/diagram" xmlns:odgm="http://opendope.org/SmartArt/DataHierarchy" xmlns:we="http://schemas.microsoft.com/office/webextensions/webextension/2010/11" xmlns:c14="http://schemas.microsoft.com/office/drawing/2007/8/2/chart" xmlns:odc="http://opendope.org/conditions" xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main">
<w:p w:rsidR="00CC3B88" ins:rsidR="true" w:rsidRDefault="00AA362D">
<w:r xmlns:xalan="http://xml.apache.org/xalan" xmlns:pkg="http://schemas.microsoft.com/office/2006/xmlPackage" xmlns:ins="http://www.topologi.com/2005/Diff-X">
<w:t xml:space="preserve">This is sample </w:t>
</w:r>
<dfx:ins>
<w:r xmlns:xalan="http://xml.apache.org/xalan" xmlns:pkg="http://schemas.microsoft.com/office/2006/xmlPackage" xmlns:ins="http://www.topologi.com/2005/Diff-X">
<w:t xml:space="preserve">doc</w:t>
</w:r>
</dfx:ins>
<w:bookmarkStart w:id="0" w:name="_GoBack"/>
<dfx:del>
<w:r xmlns:xalan="http://xml.apache.org/xalan" xmlns:pkg="http://schemas.microsoft.com/office/2006/xmlPackage" xmlns:ins="http://www.topologi.com/2005/Diff-X">
<w:t xml:space="preserve">doc</w:t>
</w:r>
</dfx:del>
<w:bookmarkEnd w:id="0"/>
</w:p>
<w:sectPr w:rsidR="00CC3B88" ins:rsidR="true">
<w:pgSz w:h="15840" w:w="12240"/>
<w:pgMar w:bottom="1440" w:footer="720" w:gutter="0" w:header="720" w:left="1440" w:right="1440" w:top="1440"/>
<w:cols w:space="720"/>
<w:docGrid w:linePitch="360"/>
</w:sectPr>
</w:body>