how to solve this Exception when I use docx4j with weblogic to open docx file. follow is my code:
- Code: Select all
WordprocessingMLPackage templatePackage = WordprocessingMLPackage
.load(getDocxInputStream());
catch Exception:
- Code: Select all
2013-04-03 18:10:29 ERROR ContentTypeManager:698 - java.lang.NullPointerException
org.docx4j.openpackaging.exceptions.InvalidFormatException: Bad [Content_Types].xml
at org.docx4j.openpackaging.contenttype.ContentTypeManager.parseContentTypesFile(ContentTypeManager.java:699)
at org.docx4j.openpackaging.io.LoadFromZipNG.process(LoadFromZipNG.java:206)
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:213)
at org.docx4j.openpackaging.packages.WordprocessingMLPackage.load(Wordpr ocessingMLPackage.java:184)
so I add jaxb-api.jar and jaxb-impl.jar (2.2.6) in classpath it work ok but it throw a new error :
- Code: Select all
ERROR NamespacePrefixMapperUtils:116 - name: com.sun.xml.internal.bind.namespacePrefixMapper value: org.docx4j.jaxb.NamespacePrefixMapperRelationshipsPartSunInternal@692098 .. trying RI.
I use java 1.6 docx4j 2.8.1.
Thanks advance!