- Code: Select all
java.lang.NullPointerException
at org.docx4j.wml.Id.hashCode(Id.java:129)
at java.util.HashMap.put(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.AssociationMap.addInner(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.recordInnerPeer(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StructureLoader.startElement(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.InterningXmlVisitor.startElement(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.SAXConnector.startElement(Unknown Source)
at com.sun.xml.internal.bind.unmarshaller.DOMScanner.visit(Unknown Source)
at com.sun.xml.internal.bind.unmarshaller.DOMScanner.visit(Unknown Source)
at com.sun.xml.internal.bind.unmarshaller.DOMScanner.visit(Unknown Source)
at com.sun.xml.internal.bind.unmarshaller.DOMScanner.visit(Unknown Source)
at com.sun.xml.internal.bind.unmarshaller.DOMScanner.visit(Unknown Source)
at com.sun.xml.internal.bind.unmarshaller.DOMScanner.visit(Unknown Source)
at com.sun.xml.internal.bind.unmarshaller.DOMScanner.visit(Unknown Source)
at com.sun.xml.internal.bind.unmarshaller.DOMScanner.visit(Unknown Source)
at com.sun.xml.internal.bind.unmarshaller.DOMScanner.visit(Unknown Source)
at com.sun.xml.internal.bind.unmarshaller.DOMScanner.scan(Unknown Source)
at com.sun.xml.internal.bind.unmarshaller.DOMScanner.scan(Unknown Source)
at com.sun.xml.internal.bind.unmarshaller.DOMScanner.scan(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.BinderImpl.associativeUnmarshal(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.BinderImpl.unmarshal(Unknown Source)
at org.docx4j.openpackaging.parts.JaxbXmlPartXPathAware.unmarshal(JaxbXmlPartXPathAware.java:171)
at org.docx4j.openpackaging.io.LoadFromZipNG.getRawPart(LoadFromZipNG.java:560)
at org.docx4j.openpackaging.io.LoadFromZipNG.getPart(LoadFromZipNG.java:429)
at org.docx4j.openpackaging.io.LoadFromZipNG.addPartsFromRelationships(LoadFromZipNG.java:352)
at org.docx4j.openpackaging.io.LoadFromZipNG.process(LoadFromZipNG.java:245)
at org.docx4j.openpackaging.io.LoadFromZipNG.get(LoadFromZipNG.java:193)
at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:301)
at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:245)
at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:195)
at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:178)
at org.docx4j.openpackaging.packages.WordprocessingMLPackage.load(WordprocessingMLPackage.java:172)
I searched forum and saw that link:
http://www.docx4java.org/forums/data-binding-java-f16/npe-in-customxmlbinding-with-old-jaxb-2-1-2-t459.html
so I downloaded last version of docx4j and built it with the following patch in org.docx4j.wml.Id file:
- Code: Select all
public int hashCode() {
if (val==null) {
return Math.abs(new java.util.Random().nextInt());
}
return val.intValue();
}
I can't compile it properly without change restriction access to rt.jar, and on top of that, after merging with another docx, the resulting file is corrupted...
for example in org.merlin.io.DOMSerializerEgine.java, it raises an error because of restricted access to rt.jar, when using JavaSE-1.6 system library:
- Code: Select all
String ianaEncoding = com.sun.org.apache.xerces.internal.util.EncodingMap.getJava2IANAMapping(javaEncoding);
can we consider it as a bug and is it possible to include patch in next nighty build please ?
best regards