draco1023 / poi-tl-ext

Extensions for poi-tl
Apache License 2.0
211 stars 53 forks source link

运行报错 java.lang.NoSuchMethodError: org.jsoup.Jsoup.parse #70

Closed sos233 closed 1 year ago

sos233 commented 1 year ago

Describe the bug 运行报错,不加html转换时,是可以正常导出word的,加了以后就会报错,麻烦看下是什么问题

HTML content: ERROR [org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/].[dispatcherServlet]:175] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: org.jsoup.Jsoup.parse(Ljava/lang/String;Lorg/jsoup/parser/Parser;)Lorg/jsoup/nodes/Document;] with root cause java.lang.NoSuchMethodError: org.jsoup.Jsoup.parse(Ljava/lang/String;Lorg/jsoup/parser/Parser;)Lorg/jsoup/nodes/Document; at org.ddr.poi.html.util.JsoupUtils.parse(JsoupUtils.java:133) at org.ddr.poi.html.HtmlRenderPolicy.doRender(HtmlRenderPolicy.java:148) at com.deepoove.poi.policy.AbstractRenderPolicy.render(AbstractRenderPolicy.java:66) at com.deepoove.poi.render.processor.DelegatePolicy.invoke(DelegatePolicy.java:45) at com.deepoove.poi.render.processor.ElementProcessor.visit(ElementProcessor.java:65) at com.deepoove.poi.render.processor.ElementProcessor.visit(ElementProcessor.java:59) at com.deepoove.poi.template.run.RunTemplate.accept(RunTemplate.java:64) at com.deepoove.poi.render.processor.DocumentProcessor.visit(DocumentProcessor.java:95) at com.deepoove.poi.template.run.RunTemplate.accept(RunTemplate.java:64) at com.deepoove.poi.render.processor.DocumentProcessor.lambda$process$0(DocumentProcessor.java:59) at java.util.ArrayList.forEach(ArrayList.java:1257) at com.deepoove.poi.render.processor.DocumentProcessor.process(DocumentProcessor.java:59) at com.deepoove.poi.render.DefaultRender.renderTemplate(DefaultRender.java:82) at com.deepoove.poi.render.DefaultRender.render(DefaultRender.java:64) at com.deepoove.poi.XWPFTemplate.render(XWPFTemplate.java:209)

Expected behavior

Screenshots

com.deepoove poi-tl 1.12.1
    <dependency>
        <groupId>io.github.draco1023</groupId>
        <artifactId>poi-tl-ext</artifactId>
        <version>0.4.2-poi5</version>
    </dependency>

Additional context Add any other context about the problem here.

sos233 commented 1 year ago

找到原因了,项目里引用了低版本的org.jsoup 1.14.2包导致冲突了,去掉相关引用或者升级到1.15.3就可以了