我有HTML文件,我想使用iTextPdf转换为pdf,但我收到以下错误,
java.lang.NoSuchMethodError:
com.itextpdf.text.log.LoggerFactory.getLogger(Ljava/lang/Class;)
Lcom/itextpdf/text/log/Logger;
lib如下
请指导我解决这个问题,提前谢谢
编辑:
java.lang.NoSuchMethodError: com.itextpdf.text.log.LoggerFactory.getLogger(Ljava/lang/Class;)Lcom/itextpdf/text/log/Logger;
at com.itextpdf.tool.xml.net.FileRetrieveImpl.<clinit>(FileRetrieveImpl.java:67)
at com.itextpdf.tool.xml.css.StyleAttrCSSResolver.<init>(StyleAttrCSSResolver.java:113)
at com.itextpdf.tool.xml.css.StyleAttrCSSResolver.<init>(StyleAttrCSSResolver.java:102)
at com.itextpdf.tool.xml.css.StyleAttrCSSResolver.<init>(StyleAttrCSSResolver.java:90)
at com.itextpdf.tool.xml.XMLWorkerHelper.parseXHtml(XMLWorkerHelper.java:213)
at com.itextpdf.tool.xml.XMLWorkerHelper.parseXHtml(XMLWorkerHelper.java:185)
课程路径
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/itext-pdfa-5.5.2-javadoc.jar"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/itext-pdfa-5.5.2-sources.jar"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/itext-pdfa-5.5.2.jar"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/itext-xtra-5.5.2-javadoc.jar"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/itext-xtra-5.5.2-sources.jar"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/itext-xtra-5.5.2.jar"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/itextpdf-5.5.2-javadoc.jar"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/itextpdf-5.5.2-sources.jar"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/itextpdf-5.5.2.jar"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/xmlworker-5.5.2.jar"/>
答案 0 :(得分:2)
你还必须在你的lib中放入以下jar文件。
根据适当的版本。 试着把整个必需的代码。
查看堆栈恍惚,它可能是指发生错误的类行。