Error Creating PDF...with workaround


#1

I’ve run into this a couple of times…so I thought I post it here. I don’t believe it’s a bug so won’t post on Atlassian. (I will post there if anyone thinks it’s useful)

PDF report is created using cfsavecontent/cfdocument.
User reports “Error opening PDF” browser message. No PDF is created.

Exception Log shows

;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…

This is misleading…

Restart Lucee service, try to produce report again. Same browser error however a different server error message

;can’t create file C:\inetpub\wwwroot\intranet\WEB-INF\lucee\temp\fonts. lmdp, file already exists;lucee.runtime.exp.NativeException: can’t create file C:\inetpub\wwwroot\intranet\WEB-INF\lucee\temp\fonts. lmdp, file already exists

So…stop Lucee service. Delete the 3 lmdp files in WEB-INF\lucee\temp\fonts.

Restart service

Retry report and viola! Working.


#2

that’s a great bug report!


#3

Can you have a exception log for the “org.zefer.pd4ml.PD4ML” error. If yes can you please post here


#4

Sure thing @cfmitrah

"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];)

#5

Hi @Jay_B,

Yup, I couldn’t able to reproduce the issue. Can you post your code, your lucee and java environment. I think it may related to https://luceeserver.atlassian.net/browse/LDEV-1849.


#6

Thanks @cfmitrah . I can’t reliably reproduce it either…it’s just happened 3 times in production in the last 6 months or so. I haven’t been able to determine what the conditions are that cause the issue. Seems to be a process holding on to a lock too long or something. But once it happens the only fix is that noted above. This unpredictability is why I mentioned I wasn’t sure it was a bug (and didn’t report it as such) It may simply be unique to our environment…but in case it wasn’t I posted the workaround.

My output doesn’t include images so I’m not sure that 1849 applies…

Oh…FWIW Lucee 5.2.8.50, Tomcat/8.5.11, Windows Server 2012 R2 (6.3) 64bit