tracker issue : CF-4095231

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

NullPointerException shortly after application start when using cfimage action=captcha

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Chris Hopkins / Chris Hopkins (Chris Hopkins)

Created: 12/03/2015

Components: CFIMAGE

Versions: 11.0

Failure Type: Crash

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Major / Some users will encounter

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

Vote Count: 0

Listed in the version 2016.0.03.300466 Issues Fixed doc
Problem Description:

After performing an app restart via application.stop() we usually get a couple of the below from pages using cfimage action=captcha. I know this is happening at least after all code within the onApplicationStart() method has run aswe have the time dumped at the start and end of the onApplicationStart() method.

Steps to Reproduce:

Call application.stop() while under moderate load and the odd page will throw this error

Actual Result:

NullPointerException

Expected Result:

All works

Any Workarounds:

Timings:

onApplicationStart Start {ts '2015-11-30 14:33:48'} 
onApplicationStart End {ts '2015-11-30 14:34:13'}
Error Timestamp: {ts '2015-11-30 14:34:18'} 

Brief Excerpt from error:

EXCEPTION:  
	[struct]
	Cause:  
		[struct]
		Message: [empty string]
		StackTrace: java.lang.NullPointerException
			at coldfusion.image.CaptchaMaker.getUserFonts(CaptchaMaker.java:374)
			at coldfusion.image.CaptchaMaker.(CaptchaMaker.java:116)
			at coldfusion.tagext.io.ImageTag.handleCaptchaRequest(ImageTag.java:515)
			at coldfusion.tagext.io.ImageTag.doStartTag(ImageTag.java:338)
			at cfreview_add2ecfm2023801284.runPage(A:\PATH-REMOVED\review_add.cfm:393)
			at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:246)

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

Watson Bug ID:	4095231

External Customer Info:
External Company:  
External Customer Name: Chris Hopkins
External Customer Email:  
External Test Config: My Hardware and Environment details: 



IIS 7.5

Win server 2008

CF11 update 7, but has happened on since we switched to CF11 ( from hotfix 5 onward )

Attachments:

  1. December 09, 2015 00:00:00: 1_captcha-null-pointer-exception.txt

Comments:

Hi Chris, I am unable to repro this issue. Maybe I am missing some detail that you have in your code, could you please share your code snippet for the same. Also do share your environment details Thanks!
Comment by S P.
5164 | December 07, 2015 04:48:36 AM GMT
It happens on numerous pages on our websites where we use the following code - taken from line 393 of review_add.cfm. Also i do not know if it happens on every load of a captcha or just some, i just see a few of the following on a restart on occasion. <cfimage action="captcha" height="33" width="200" text="#review_add.captcha#" difficulty="low" fonts="verdana,arial" fontsize="20" /> - Also this is the function used to generate the text used for the captcha <cffunction name="getCaptchaString" returntype="string" output="false"> <cfargument name="length" required="false" default="6" /> <cfset var local = {} /> <cfset local.captcha_string = "" /> <cfset local.arr_characters = ListToArray( "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,2,3,4,5,6,7,8,9" ) /> <!--- Now, shuffle the array. ---> <cfset CreateObject( "java", "java.util.Collections" ).Shuffle( arr_characters ) /> <!--- Now that we have a shuffled array, let's grab the first 8 characters as our CAPTCHA text string. ---> <cfloop from="1" to="#arguments.length#" index="local.i"> <cfset local.captcha_string = local.captcha_string & arr_characters[ randRange(1,arrayLen(local.arr_characters)) ] /> </cfloop> <cfreturn local.captcha_string /> </cffunction> More specific environment details: Server Product ColdFusion Version 11,0,07,296330 Tomcat Version 7.0.64.0 Edition Enterprise Operating System Windows Server 2008 R2 OS Version 6.1 Update Level C:/ColdFusion11/cfusion/lib/updates/chf11000007.jar Adobe Driver Version 5.1.3 (Build 000094) JVM Details Java Version 1.8.0_66
Comment by External U.
5165 | December 07, 2015 05:17:12 AM GMT
Added the full error as a txt file - thought i had done this when creating the ticket but apparently not.
Comment by External U.
5166 | December 09, 2015 05:13:48 AM GMT
any update on this?
Comment by External U.
5167 | January 29, 2016 07:22:49 AM GMT
Hi Chris, We have not been able to repro this case.Can you provide your entire application (with application.cfc/cfm content) to repro it. Thanks!
Comment by S P.
5168 | June 14, 2016 05:33:29 AM GMT
ill see if i can get something trimmed down over to you - what email address should i send it to (would prefer not to attach to ticket)
Comment by External U.
5169 | June 14, 2016 06:17:55 AM GMT
Hi Chris, Do let us know if, after applying the patch, it solves the issue Thanks, Preethi
Comment by S P.
5170 | August 18, 2016 04:36:01 AM GMT
Hi Preethi, It would help if you could send me the patch to test
Comment by External U.
5171 | August 18, 2016 06:22:01 AM GMT
Hey Chris, I had send a zipped folder of the patch over mail, looks like it is not delivered. Will share it again, please check. Thanks!
Comment by S P.
5172 | August 18, 2016 10:33:21 PM GMT
Chris has confirmed the working of the patch provided, hence closing the bug. Thanks Chris! Regards, Preethi
Comment by S P.
5173 | September 01, 2016 05:46:39 AM GMT