消息关闭
    暂无新消息!
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.poi.POIXMLDocumentPart.getPackageRelationship()Lorg/apache/poi/openxml4j/opc/PackageRelationship;
at org.apache.poi.xwpf.converter.core.styles.XWPFStylesDocument.getThemeDocuments(XWPFStylesDocument.java:1235)
at org.apache.poi.xwpf.converter.core.styles.run.RunFontFamilyValueProvider.getFontFamily(RunFontFamilyValueProvider.java:81)
at org.apache.poi.xwpf.converter.core.styles.run.RunFontFamilyValueProvider.getValue(RunFontFamilyValueProvider.java:49)
at org.apache.poi.xwpf.converter.core.styles.XWPFStylesDocument.getFontFamilyAscii(XWPFStylesDocument.java:444)
at org.apache.poi.xwpf.converter.xhtml.internal.styles.CSSStylesDocument.createCSSStyle(CSSStylesDocument.java:260)
at org.apache.poi.xwpf.converter.xhtml.internal.styles.CSSStylesDocument.visitStyle(CSSStylesDocument.java:240)
at org.apache.poi.xwpf.converter.xhtml.internal.styles.CSSStylesDocument.visitStyle(CSSStylesDocument.java:127)
at org.apache.poi.xwpf.converter.core.styles.XWPFStylesDocument.initialize(XWPFStylesDocument.java:232)
at org.apache.poi.xwpf.converter.xhtml.internal.styles.CSSStylesDocument.initialize(CSSStylesDocument.java:116)
at org.apache.poi.xwpf.converter.xhtml.internal.styles.CSSStylesDocument.<init>(CSSStylesDocument.java:103)
at org.apache.poi.xwpf.converter.xhtml.internal.XHTMLMapper.createStylesDocument(XHTMLMapper.java:131)
at org.apache.poi.xwpf.converter.core.XWPFDocumentVisitor.<init>(XWPFDocumentVisitor.java:153)
at org.apache.poi.xwpf.converter.xhtml.internal.XHTMLMapper.<init>(XHTMLMapper.java:121)
at org.apache.poi.xwpf.converter.xhtml.XHTMLConverter.convert(XHTMLConverter.java:67)
at org.apache.poi.xwpf.converter.xhtml.XHTMLConverter.doConvert(XHTMLConverter.java:58)
at org.apache.poi.xwpf.converter.xhtml.XHTMLConverter.doConvert(XHTMLConverter.java:38)
at org.apache.poi.xwpf.converter.core.AbstractXWPFConverter.convert(AbstractXWPFConverter.java:45)
at com.gzz100.officeUtil.Word2007ToHtml.canExtractImage(Word2007ToHtml.java:46)
at com.gzz100.officeUtil.Word2007ToHtml.main(Word2007ToHtml.java:55)

5个回答

︿ 2
我导入jar包了,然后网上说要org.apache.poi.xwpf.converter.core-1.0.4.jar,org.apache.poi.xwpf.converter.xhtml-1.0.4.jar,poi版本为3.16,然后在main方法中测试就要报错,代码是网上找的,但是不能运行会报错
︿ 1
发现应该是poi版本jar包冲突了,把版本换低兼容了,但是就是不能同时将ppt07以下的转换成html和ppt07以上的转换成html,
︿ 0
我发现org.apache.poi.xwpf.converter.core-1.0.4.jar依赖的是poi-ooxml-3.9.jar,项目中还导入了一个poi-ooxml-3.16.jar但是在apache poi官网没有看到poi-3.9的版本