0

当我使用 docx4j 和 weblogic 打开 docx 文件时如何解决这个异常。以下是我的代码:

WordprocessingMLPackage templatePackage = WordprocessingMLPackage
                .load(getDocxInputTream());

例外是:

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)

提前谢谢!

4

0 回答 0