tracker issue : CF-4188077

select a category, or use search below
(searches all categories and all time range)

cfprint with usepdfpagesize is throwing null pointer exception occasionally

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/CustomerSupport

Reporter/Name(from Bugbase): Eric Harris / Eric Harris (Eric Harris)

Created: 09/09/2016

Components: CFPRINT

Versions: 2016,11.0

Failure Type:

Found In Build/Fixed In Build: CF11_Final / 303781

Priority/Frequency: Major / Some users will encounter

Locale/System: English / Win 2008 Server R2 64 bit

Vote Count: 0

Problem Description:  Once or twice a day ( have determined this is happening about 3% of the time over time ) Coldfusion will throw a nullpointerexception ( Message has empty string ) when trying to use the cfprint command and the following attributes:
            <cfset aset=StructNew()> 
            <cfset aset["usePdfPageSize"] = "yes">
            <cfset aset["autoRotateAndCenter"] = "no">
            <cfset aset["orientation"] = "portrait">
            <cfset aset["paper"] = "letter"> 
            <cfset aset["sides"] = "one-sided"> 
            <cfset aset["copies"] = "1"> 
            <cfset aset["printer"] = "#getPrinter.printer#"> 
            <cfprint type="pdf" source="mypdf" attributeStruct="#aset#">

I think I have tracked this down to the use of the usePdfPageSize command based on the stack trace.  If we turn this off, however, then the pdf's are not displaying properly when printed.  If the user then turns around and tries to print the same receipt, the operation will complete successfully.  

Steps to Reproduce:  This is an occasional issue, but happens 1 to 2 a day on different printers

Actual Result: Null Pointer exception is thrown and user sees error message

Expected Result: User should see PDF document

Any Workarounds: None/Print document again

Errors in Logs:


Sep 9, 2016 11:52:06 AM Information [ajp-bio-8014-exec-13] - Print job 'ColdFusion Print Job' started.  Printer 'M23-PRINTER'.
Sep 9, 2016 11:52:09 AM Information [ajp-bio-8014-exec-13] - Could not print PDF document.


"Information","ajp-bio-8014-exec-13","09/09/16","11:52:06",,"Print job 'ColdFusion Print Job' started.  Printer 'M23-PRINTER'."


"Information","ajp-bio-8014-exec-13","09/09/16","11:52:09","PROD_CFNAME","Could not print PDF document."

Stack Trace:

java.lang.NullPointerException at org.jpedal.utils.PdfPageFormat.getDefaultMediaSizeName(Unknown Source) at org.jpedal.utils.PdfPageFormat.getDefaultPage(Unknown Source) at org.jpedal.utils.PdfPageFormat.getAppropriatePageFormat(Unknown Source) at org.jpedal.utils.PdfPageFormat.getPageFormat(Unknown Source) at org.jpedal.utils.PdfBook.updatePages(Unknown Source) at org.jpedal.utils.PdfBook.setChooseSourceByPdfPageSize(Unknown Source) at coldfusion.print.PrintPDF.printPdf( at coldfusion.print.PrintPDF._print( at coldfusion.print.PrintPDF.print( at coldfusion.tagext.lang.PrintTag.doEndTag( at coldfusion.runtime.CfJspPage._emptyTcfTag( at cfWRRECPT2ecfm648095540$funcPRINTANDGENERATEPDF._factor14(C:\inetpub\wwwroot\mprod\reports\WRRECPT.cfm:150) at

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4188077

External Customer Info:
External Company:  
External Customer Name: Eric Harris
External Customer Email:  
External Test Config: My Hardware and Environment details:

Coldfusion 11 64 bit, Patch 8 Windows 2008 R2 64 bit, IIS 7.5, Internet Explorer 11


  1. September 21, 2016 00:00:00:


Seems kinda random that this is happening. In this instance, at 11:50 the printer M23-PRINTER was printed to. At 11:52 it had the error above, then at 11:56 the process completed.
Comment by External U.
1852 | September 09, 2016 11:54:17 AM GMT
Eric, I tried to reproduce this but couldnot. Could you please let me know on which CF 11 version you are trying?
Comment by Poonam J.
1853 | September 15, 2016 05:42:49 AM GMT
We're on Coldfusion 11 patch 8 in production where this happens. Again this doesn't happen every time we make the call, it just happens 1 to 2 a day consistently ( over 150 => 200 calls estimating )..
Comment by External U.
1854 | September 15, 2016 02:27:32 PM GMT
Hi Eric, Could you please let us know the make and model ( or software name and version number for virtual printers ) for the printer that is set as system default. Is your server running on Java 7 or Java 8?
Comment by Krishna R.
1855 | September 21, 2016 02:28:44 AM GMT
Eric, Could you please provide the info request by KP?
Comment by Poonam J.
1856 | September 21, 2016 03:25:43 AM GMT
c:\coldfusion11\jre c:\ColdFusion11\jre\bin>java -version java version "1.7.0_55" Java(TM) SE Runtime Environment (build 1.7.0_55-b13) Java HotSpot(TM) 64-Bit Server VM (build 24.55-b03, mixed mode)
Comment by External U.
1857 | September 21, 2016 10:01:56 AM GMT
uploaded receipt fails.xlsx with frequency we're seeing and some printer models.
Comment by External U.
1858 | September 21, 2016 10:04:13 AM GMT