hi guys,
i am a rookey in docx4j,
i am trying to create a sample application using docx4j
some code part is like this
- Code: Select all
org.docx4j.openpackaging.packages.WordprocessingMLPackage.load(inputFile);
i am experiencing a null pointer exception here, i'm sure about input file path.
i believe exception is with WordprocessingMLPackage.
exception is like below
JAXB: RI not present. Trying Java 6 implementation.
JAXB: Using Java 6 implementation.
log4j:WARN No appenders could be found for logger (org.docx4j.jaxb.Context).
log4j:WARN Please initialize the log4j system properly.
java.lang.NullPointerException
at org.docx4j.wml.Id.hashCode(Id.java:129)
at java.util.HashMap.put(HashMap.java:372)
at com.sun.xml.internal.bind.v2.runtime.AssociationMap.addInner(AssociationMap.java:78)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.recordInnerPeer(UnmarshallingCont
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StructureLoader.startElement(StructureLoader.java:147)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContex
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.InterningXmlVisitor.startElement(InterningXmlVisitor.j
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.SAXConnector.startElement(SAXConnector.java:101)
at com.sun.xml.internal.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:224)
at com.sun.xml.internal.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:261)
at com.sun.xml.internal.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:230)
at com.sun.xml.internal.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:261)
at com.sun.xml.internal.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:230)
at com.sun.xml.internal.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:261)
at com.sun.xml.internal.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:230)
at com.sun.xml.internal.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:261)
at com.sun.xml.internal.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:230)
at com.sun.xml.internal.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:261)
at com.sun.xml.internal.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:230)
at com.sun.xml.internal.bind.unmarshaller.DOMScanner.scan(DOMScanner.java:107)
at com.sun.xml.internal.bind.unmarshaller.DOMScanner.scan(DOMScanner.java:90)
at com.sun.xml.internal.bind.unmarshaller.DOMScanner.scan(DOMScanner.java:83)
at com.sun.xml.internal.bind.v2.runtime.BinderImpl.associativeUnmarshal(BinderImpl.java:139)
at com.sun.xml.internal.bind.v2.runtime.BinderImpl.unmarshal(BinderImpl.java:111)
at org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart.unmarshal(MainDocumentPart.java:262)
at org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart.unmarshal(MainDocumentPart.java:76)
at org.docx4j.openpackaging.io.LoadFromZipNG.getRawPart(LoadFromZipNG.java:546)
at org.docx4j.openpackaging.io.LoadFromZipNG.getPart(LoadFromZipNG.java:422)
at org.docx4j.openpackaging.io.LoadFromZipNG.addPartsFromRelationships(LoadFromZipNG.java:351)
at org.docx4j.openpackaging.io.LoadFromZipNG.process(LoadFromZipNG.java:236)
at org.docx4j.openpackaging.io.LoadFromZipNG.get(LoadFromZipNG.java:189)
at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:188)
at org.docx4j.openpackaging.packages.WordprocessingMLPackage.load(WordprocessingMLPackage.java:169)
at com.temenos.sizing.docWithXml.<init>(docWithXml.java:89)
at com.temenos.sizing.GetDocument.jButton1ActionPerformed(GetDocument.java:856)
at com.temenos.sizing.GetDocument.access$000(GetDocument.java:27)
at com.temenos.sizing.GetDocument$1.actionPerformed(GetDocument.java:291)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6038)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
at java.awt.Component.processEvent(Component.java:5803)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4410)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2429)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
using java6
IDE eclipse-indigo
jars:docx4j-2.6.0.jar,log4j-1.2.13.jar,jaxb-api-2.1.jar