简体   繁体   中英

java.lang.NoSuchMethodError: >org.xhtmlrenderer.layout.SharedContext: method <init>()V not found

I am trying to generate a pdf from an html file.when I run my code from eclipse everything works fine and the pdf is created successfully.However when I create the jar file and run it,at the moment of creating the pdf I get this error:

Exception in thread "Thread-4" java.lang.NoSuchMethodError: org.xhtmlrenderer.la
yout.SharedContext: method <init>()V not found
at org.xhtmlrenderer.pdf.ITextRenderer.<init>(ITextRenderer.java:107)
at org.xhtmlrenderer.pdf.ITextRenderer.<init>(ITextRenderer.java:98)

Anyone has an idea how to resolve this?

¿How are you generating the jar?

Ensure you are using the same flyingsaucer-renderer.jar version when run from eclipse and when run the jar. If you are using maven is possible that have been generated duplicated dependencies.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM