Title:
cfprint with usepdfpagesize is throwing null pointer exception occasionally
| View in TrackerStatus/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:
coldfusion-out.log:
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.
print.log:
"Information","ajp-bio-8014-exec-13","09/09/16","11:52:06",,"Print job 'ColdFusion Print Job' started. Printer 'M23-PRINTER'."
myapperrorlog.log:
"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(PrintPDF.java:261) at coldfusion.print.PrintPDF._print(PrintPDF.java:158) at coldfusion.print.PrintPDF.print(PrintPDF.java:77) at coldfusion.tagext.lang.PrintTag.doEndTag(PrintTag.java:564) at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2992) 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
Attachments:
- September 21, 2016 00:00:00: 1_Receipt_Fails.zip
Comments: