Lucee 5.3.5.78-RC Error (java.lang.NoSuchMethodError) com.lowagie.text.pdf.BaseFont.getCharBBox

I have a simple CFM script putting together some images into a PDF. It has been working for a while just fine until this week, I think after I updated Lucee to v5.3. This is only happening to me in production, on a windows server. I use a Mac for local development and I have had Lucee 5.3 for a while with no issues. The same exact script with the same images works fine on the Mac. I have tried updating all components, Lucee and extensions, updated Java, tried flying sauscer jars v9.1.16… no luck.

Any help would be greatly appreciated.

Here is the error:

Lucee 5.3.5.78-RC Error (java.lang.NoSuchMethodError)
Message com.lowagie.text.pdf.BaseFont.getCharBBox(I)[I
Stacktrace The Error Occurred in
C:\inetpub\wwwroot\mtsinspect\qpsitime\ExpenseReport.cfm: line 518

516:
517:
518:
519:
520:
called from C:\inetpub\wwwroot\mtsinspect\Application.cfc: line 451
Java Stacktrace lucee.runtime.exp.NativeException: com.lowagie.text.pdf.BaseFont.getCharBBox(I)[I
at org.xhtmlrenderer.pdf.ITextFontResolver$FontDescription.setMetricDefaults(ITextFontResolver.java:841)
at org.xhtmlrenderer.pdf.ITextFontResolver$FontDescription.(ITextFontResolver.java:772)
at org.xhtmlrenderer.pdf.ITextFontResolver.addCourier(ITextFontResolver.java:506)
at org.xhtmlrenderer.pdf.ITextFontResolver.createInitialFontMap(ITextFontResolver.java:474)
at org.xhtmlrenderer.pdf.ITextFontResolver.(ITextFontResolver.java:43)
at org.xhtmlrenderer.pdf.ITextRenderer.(ITextRenderer.java:124)
at org.xhtmlrenderer.pdf.ITextRenderer.(ITextRenderer.java:110)
at org.xhtmlrenderer.pdf.ITextRenderer.(ITextRenderer.java:106)
at org.xhtmlrenderer.pdf.ITextRenderer.(ITextRenderer.java:102)
at org.lucee.extension.pdf.xhtmlrenderer.FSPDFDocument.render(FSPDFDocument.java:64)
at org.lucee.extension.pdf.tag.Document.renderInital(Document.java:718)
at org.lucee.extension.pdf.tag.Document._doAfterBody(Document.java:622)
at org.lucee.extension.pdf.tag.Document.doAfterBody(Document.java:574)
at mtsinspect.qpsitime.expensereport_cfm$cf.call(/MTSInspect/QPSITime/ExpenseReport.cfm:518)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:944)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:836)
at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:818)
at mtsinspect.application_cfc$cf.udfCall(/MTSInspect/Application.cfc:451)
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.listener.ModernAppListener.call(ModernAppListener.java:436)
at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:215)
at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:42)
at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2415)
at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2405)
at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2380)
at lucee.runtime.engine.Request.exe(Request.java:43)
at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1126)
at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1072)
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: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.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.NoSuchMethodError: com.lowagie.text.pdf.BaseFont.getCharBBox(I)[I
… 57 more
Timestamp 2/28/20 7:35:55 AM CST

Don’t forget to tell us about your stack!

OS: Windows Server 2012
Java Version: 1.8.0_241
Tomcat Version: Apache Tomcat/8.5.33
Lucee Version: Lucee 5.3.5.78-RC

is a font missing?

I don’t think so. I am only adding an image to PDF, no additional processing. Here is the code snippet:

            <cfdocument format="PDF" filename="#fullTempDirectory#/#thefilename#.pdf" pageheight="11" pagewidth="8.5" overwrite="true">
              <cftry>

              <!--- Create a ColdFusion image from an existing JPEG file. --->
              <cfimage source="#fullTempDirectory#/#thefilename#" name="myImage">
              <!--- Turn on antialiasing to improve image quality. --->
              <cfset ImageSetAntialiasing(myImage,"on")>
              <cfset ImageScaleToFit(myImage,500,"","lanczos")>
              <cfset myImage = rightUpImage(myImage)>
              <!--- Display the modified image in a browser. --->
              <cfimage source="#myImage#" action="writeToBrowser">
              <cfcatch type="any">
                Error including file for expense_id: #expenseid#, filename: #thefilename#
              </cfcatch>
              </cftry>
            </cfdocument>

Ok, I got it figured out. Rookie mistake.

I found another version of iText 2.0.2 left over in my libs folder, together with other 3rd party JARs I am using. After removing iText 2.0.2, I only have the latest 2.1.7 in the bundles lucee folder. That fixed the error.

5 Likes