asciidocfx / AsciidocFX

Asciidoc Editor and Toolchain written with JavaFX 21 (Build PDF, Epub, Mobi and HTML books, documents and slides)
http://www.asciidocfx.com/
Apache License 2.0
1.89k stars 297 forks source link

NullPointerException while converting to PDF #444

Closed mikes222 closed 4 years ago

mikes222 commented 4 years ago

After the latest Windows 10 update AsciidocFx is not able to convert even the simplest text to PDF. This is the error message:

ERROR => Problem occured while converting to PDF
java.lang.NullPointerException: null
at com.kodedu.service.convert.pdf.PdfBookConverter.lambda$convert$0(PdfBookConverter.java:92)
at com.kodedu.service.convert.docbook.DocBookConverter.lambda$convert$1(DocBookConverter.java:83)
at com.kodedu.service.ThreadService$1.call(ThreadService.java:48)
at javafx.graphics/javafx.concurrent.Task$TaskCallable.call(Task.java:1425)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1406)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)

The temp-file is successfully and fully created.

java -version
openjdk version "12.0.1" 2019-04-16
OpenJDK Runtime Environment AdoptOpenJDK (build 12.0.1+12)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 12.0.1+12, mixed mode)

AsciiDocFX 1.7.1

Any help would be appreciated. Do you need some more infos?

mikes222 commented 4 years ago

This is the source around the NullpointerException:

Transformer transformer = factory.newTransformer(new StreamSource(configPath.resolve("docbook-config/fo-pdf.xsl").toFile()));
                transformer.setParameter("highlight.xslthl.config", configPath.resolve("docbook-config/xslthl-config.xml").toUri().toASCIIString());
                transformer.setParameter("admon.graphics.path", configPath.resolve("docbook/images/").toUri().toASCIIString());
                transformer.setParameter("callout.graphics.path", configPath.resolve("docbook/images/callouts/").toUri().toASCIIString());

configPath should resolve to the installation directory. Though all mentioned files are available in the installation directory, the pdf conversion is still not working. I tried to uninstall and reinstall asciidocfx and voilá, it works again.

Problem solved.