cfdocument + https images not working in Java 9+ (PD4ML)

Description

The provided Tomcat 8.5.30 in Ubuntu 18.04 is compiled to Java 9+. I couldn't use Lucee 5.2 directly because it's not compatible with > Java 8. Lucee 5.3 does work, but there is a problem when using cfdocument with https images.

The following simple example fails:

<cfdocument> <img src="https://kleimo-blog.s3.amazonaws.com/2016/Jan/nginx_plus_lucee-1452648396319.png"> </cfdocument>

The problem is probably in PD4ML.

Stack trace:

lucee.runtime.exp.RequestTimeoutException: request /cfdocument.cfm (/var/www/cfdocument.cfm) has run into a timeout (50 seconds) and has been stopped. ▒░░░at org.zefer.html.doc.db.o00000(Unknown Source) ▒░░░at org.zefer.html.doc.Document.paint(Unknown Source) ▒░░░at org.zefer.pd4ml.PD4ML.o00000(Unknown Source) ▒░░░at org.zefer.pd4ml.PD4ML.render(Unknown Source) ▒░░░at org.zefer.pd4ml.PD4ML.render(Unknown Source) ▒░░░at java.base@10.0.1/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ▒░░░at java.base@10.0.1/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ▒░░░at java.base@10.0.1/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ▒░░░at java.base@10.0.1/java.lang.reflect.Method.invoke(Method.java:564) ▒░░░at org.lucee.extension.pdf.pd4ml.PDFByReflection.invoke(PDFByReflection.java:228) ▒░░░at org.lucee.extension.pdf.pd4ml.PDFByReflection.render(PDFByReflection.java:199) ▒░░░at org.lucee.extension.pdf.pd4ml.PD4MLPDFDocument.content(PD4MLPDFDocument.java:148) ▒░░░at org.lucee.extension.pdf.pd4ml.PD4MLPDFDocument.render(PD4MLPDFDocument.java:120) ▒░░░at org.lucee.extension.pdf.tag.Document.render(Document.java:727) ▒░░░at org.lucee.extension.pdf.tag.Document._doEndTag(Document.java:637) ▒░░░at org.lucee.extension.pdf.tag.Document.doEndTag(Document.java:574) ▒░░░at mpdupo_cfm$cf.call(/cfdocument.cfm:2) ▒░░░at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:933) ▒░░░at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:823) ▒░░░at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:225) ▒░░░at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:43) ▒░░░at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2464) ▒░░░at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2454) ▒░░░at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2427) ▒░░░at lucee.runtime.engine.Request.exe(Request.java:44) ▒░░░at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngine07-May-2018 09:00:39.463 SEVERE [http-nio-8888-exec-5] org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun▓ java.lang.ThreadDeath ▒░░░at java.base/java.lang.Thread.stop(Thread.java:949) ▒░░░at lucee.commons.io.StopThread.run(SystemUtil.java:1544)

Environment

OS: Ubuntu 18.04 - Linux (4.15.0-20-generic) 64bit
Servlet Container: Apache Tomcat/8.5.30 (Ubuntu)
Java:
openjdk version "10.0.1" 2018-04-17
OpenJDK Runtime Environment (build 10.0.1+10-Ubuntu-3ubuntu1)
OpenJDK 64-Bit Server VM (build 10.0.1+10-Ubuntu-3ubuntu1, mixed mode)
Architecture: 64bit

Activity

Show:

Guardian 14 May 2020 at 12:55

Have same issue on Lucee 5.3.4.80

Java

1.8.0_144 (Oracle Corporation) 64bit

Lucee

5.3.4.80

Servlet Container

Apache Tomcat/8.5.33

OS

Windows Server 2012 R2 (6.3) 64bit

How to fix it? Update Java?

Michael Offner 11 October 2018 at 15:01

Problem cannot be solved with the PD4ML library we used. so we switched to FlyingSaucer as our libary we use behind the curtain.
https://github.com/lucee/extension-pdf/commit/406544484b5555c12881f788f953d6a62d457a8a

you can still use the old implementation by adding the following to the Application.cfc
this.pdf.type="classic";

Michael Offner 10 October 2018 at 06:17

Pothys - MitrahSoft 20 September 2018 at 13:59

Hi ,

I think it may helps, I got from https://dev.lucee.org/t/error-creating-pdf-with-workaround/4493/4 here

ERROR","ajp-nio-8009-exec-7","09/05/2018","13:36:58","",";cannot load class through its string name, because no definition for the class with the specified name [org.zefer.pd4ml.PD4ML] could be found caused by (java.lang.ClassNotFoundException:org.zefer.pd4ml.PD4ML;java.lang.ClassNotFoundException:org. zefer.pd4ml.PD4ML;java.lang.ClassNotFoundException:org.zefer.pd4ml.PD4ML not found by lucee.core [64];);lucee.runtime.exp.NativeException: cannot load class through its string name, because no definition for the class with the specified name [org.zefer.pd4ml.PD4ML] could be found caused by (java.lang.ClassNotFoundException:org.zefer.pd4ml.PD4ML;java.lang.ClassNotFoundException:org. zefer.pd4ml.PD4ML;java.lang.ClassNotFoundException:org.zefer.pd4ml.PD4ML not found by lucee.core [64];) at lucee.commons.lang.ClassUtil.loadClass(ClassUtil.java:289) at lucee.runtime.util.ClassUtilImpl.loadClass(ClassUtilImpl.java:247) at org.lucee.extension.pdf.pd4ml.PDFByReflection.<init>(PDFByReflection.java:107) at org.lucee.extension.pdf.pd4ml.PD4MLPDFDocument.render(PD4MLPDFDocument.java:83) at org.lucee.extension.pdf.tag.Document.render(Document.java:727) at org.lucee.extension.pdf.tag.Document._doEndTag(Document.java:637) at org.lucee.extension.pdf.tag.Document.doEndTag(Document.java:574) at view.priornotice.act.act_rptrecapinvoice_cfm$cf.call(/view/priornotice/act/act_rptRecapInvoice. cfm:223) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:939) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:833) at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:223) at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:43) at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2405) at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2395) at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2363) at lucee.runtime.engine.Request.exe(Request.java:44) at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1091) at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1039) at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:102) at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:62) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) 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:474) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349) at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:478) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:798) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1434) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) Caused by: lucee.commons.lang.ClassException: cannot load class through its string name, because no definition for the class with the specified name [org.zefer.pd4ml.PD4ML] could be found caused by (java.lang.ClassNotFoundException:org.zefer.pd4ml.PD4ML;java.lang.ClassNotFoundException:org. zefer.pd4ml.PD4ML;java.lang.ClassNotFoundException:org.zefer.pd4ml.PD4ML not found by lucee.core [64];)

Pothys - MitrahSoft 2 August 2018 at 15:00

Hi ,

When I run the code in java 10, I saw the issue like below which is mentioned above.

at java.base@10.0.2/java.util.zip.Deflater.deflateBytes(Native Method) at java.base@10.0.2/java.util.zip.Deflater.deflate(Deflater.java:466) at java.base@10.0.2/java.util.zip.Deflater.deflate(Deflater.java:404) at org.zefer.pd4ml.pdf.f.o00000(Unknown Source) at org.zefer.pd4ml.pdf.c.õO0000(Unknown Source) at org.zefer.pd4ml.pdf.c.ÓÓ0000(Unknown Source) at org.zefer.pd4ml.pdf.PD4Device.startNewPage(Unknown Source) at org.zefer.pd4ml.PD4ML.o00000(Unknown Source) at org.zefer.pd4ml.PD4ML.render(Unknown Source) at org.zefer.pd4ml.PD4ML.render(Unknown Source) at java.base@10.0.2/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base@10.0.2/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base@10.0.2/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base@10.0.2/java.lang.reflect.Method.invoke(Method.java:564) at org.lucee.extension.pdf.pd4ml.PDFByReflection.invoke(PDFByReflection.java:228) at org.lucee.extension.pdf.pd4ml.PDFByReflection.render(PDFByReflection.java:199) at org.lucee.extension.pdf.pd4ml.PD4MLPDFDocument.content(PD4MLPDFDocument.java:148) at org.lucee.extension.pdf.pd4ml.PD4MLPDFDocument.render(PD4MLPDFDocument.java:120) at org.lucee.extension.pdf.tag.Document.render(Document.java:727) at org.lucee.extension.pdf.tag.Document._doEndTag(Document.java:637) at org.lucee.extension.pdf.tag.Document.doEndTag(Document.java:574) at test_cfm$cf.call(/test.cfm:2) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:936) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:826) at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:225) at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:43) at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2476) at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2466) at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2439) at lucee.runtime.engine.Request.exe(Request.java:44) at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1090) at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1038) at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:102) at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:51) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) 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:53) 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:199) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:651) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:412) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1385) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.base@10.0.2/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135) at java.base@10.0.2/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.base@10.0.2/java.lang.Thread.run(Thread.java:844) "

Doesn't able to reproduce "PD4ML is throwing an https classcastexception." error

Fixed

Details

Assignee

Reporter

Priority

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Sprint

Affects versions

Created 7 May 2018 at 07:02
Updated 13 July 2021 at 06:24
Resolved 12 October 2018 at 10:00

Flag notifications