Cfdocument - Could not initialize class org.ccil.cowan.tagsoup.HTMLScanner

Hello,

we use “cfdocument” to create PDF files from HTML in our application:
cfdocument( format="PDF", filename=FILENAME, overwrite="true", localUrl="true"){ writeOutput(HTML); }

Now we have got the following error in “cfdocument”:
Could not initialize class org.ccil.cowan.tagsoup.HTMLScanner

It’s the first time that we have got this error and we use “cfdocument” for a long time already.
The error stayed until we rebooted Tomcat.
After the Tomcat reboot the error was gone.

Does anyone know something about this error?
Has it maybe been fixed in a newer version of Lucee?

OS: CentOS Linux release 7.7.1908
Java Version: OpenJDK Runtime Environment (build 1.8.0_252-b09, mixed mode)
Tomcat Version: Apache Tomcat/8.5.35
Lucee Version: Lucee 5.3.7.43
PDF Extension Version: PDF Extension 1.0.0.81-SNAPSHOT

which version of the PDF extension are you running?

It’s PDF Extension 1.0.0.81-SNAPSHOT

Did you try with the latest PDF extension 1.0.0.96-SNAPSHOT?

We will try it, but I can’t say if it’s working or not because it was the first time that this error occured.

If possible can you share stack trace?

"ERROR","ajp-nio-8009-exec-202","05/20/2021","09:35:24","","Could not initialize class org.ccil.cowan.tagsoup.HTMLScanner;Could not initialize class org.ccil.cowan.tagsoup.HTMLScanner;lucee.runtime.exp.NativeException: Could not initialize class org.ccil.cowan.tagsoup.HTMLScanner
	at org.ccil.cowan.tagsoup.Parser.setup(Parser.java:459)
	at org.ccil.cowan.tagsoup.Parser.parse(Parser.java:439)
	at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:659)
	at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:728)
	at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:343)
	at org.lucee.extension.pdf.util.XMLUtil.parseHTML(XMLUtil.java:81)
	at org.lucee.extension.pdf.xhtmlrenderer.FSPDFDocument.parseHTML(FSPDFDocument.java:244)
	at org.lucee.extension.pdf.xhtmlrenderer.FSPDFDocument.content(FSPDFDocument.java:114)
	at org.lucee.extension.pdf.xhtmlrenderer.FSPDFDocument.render(FSPDFDocument.java:96)
	at org.lucee.extension.pdf.tag.Document.renderInital(Document.java:717)
	at org.lucee.extension.pdf.tag.Document._doAfterBody(Document.java:621)
	at org.lucee.extension.pdf.tag.Document.doAfterBody(Document.java:573)
	at File.File_cfc$cf$6fx.udfCall5(FilePath/File.cfc:1234)
	at File.File_cfc$cf$6fx.udfCall(FilePath/File.cfc)
	at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
	at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344)
	at lucee.runtime.type.UDFImpl.call(UDFImpl.java:217)
	at lucee.runtime.ComponentImpl._call(ComponentImpl.java:680)
	at lucee.runtime.ComponentImpl._call(ComponentImpl.java:568)
	at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1898)
	at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:785)
	at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1710)
	at File.File_cfc$cf$6fx.udfCall5(FilePath/File.cfc:1234)
	at File.File_cfc$cf$6fx.udfCall(FilePath/File.cfc)
	at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
	at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344)
	at lucee.runtime.type.UDFImpl.call(UDFImpl.java:217)
	at lucee.runtime.ComponentImpl._call(ComponentImpl.java:680)
	at lucee.runtime.ComponentImpl._call(ComponentImpl.java:568)
	at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1898)
	at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:785)
	at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1710)
	at File.File_cfc$cf$6fx.udfCall5(FilePath/File.cfc:1234)
	at File.File_cfc$cf$6fx.udfCall(FilePath/File.cfc)
	at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
	at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344)
	at lucee.runtime.type.UDFImpl.call(UDFImpl.java:217)
	at lucee.runtime.ComponentImpl._call(ComponentImpl.java:680)
	at lucee.runtime.ComponentImpl._call(ComponentImpl.java:568)
	at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1898)
	at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:785)
	at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1710)
	at File.File_cfc$cf.udfCall1(FilePath/File.cfc:1234)
	at File.File_cfc$cf.udfCall(FilePath/File.cfc)
	at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
	at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344)
	at lucee.runtime.type.UDFImpl.call(UDFImpl.java:217)
	at lucee.runtime.ComponentImpl._call(ComponentImpl.java:680)
	at lucee.runtime.ComponentImpl._call(ComponentImpl.java:568)
	at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1898)
	at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:785)
	at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1710)
	at File.File_cfm$cf.call(FilePath/File.cfm:1234)
	at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:945)
	at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:837)
	at lucee.runtime.listener.ClassicAppListener._onRequest(ClassicAppListener.java:64)
	at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:43)
	at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2416)
	at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2406)
	at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2381)
	at lucee.runtime.engine.Request.exe(Request.java:43)
	at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1170)
	at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1116)
	at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:97)
	at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:51)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
	at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:479)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.ccil.cowan.tagsoup.HTMLScanner
	... 88 more