The Ever Lovely Java 500 NULL error

While refactoring today, I got a dreaded Java 500 NULL error. This is by far my least favorite error because ColdFusion gives ABSOLUTELY no helpful information at all as to where the error occurred.

I am not sure why this error happens outside of the coldfusion error handler, you know, the one with the nice pretty information. Apparently it happens during a part of the process where coldfusion has no control, because coldfusion is usually tops on giving proper information onError.

After staring blankly at my screen for a few minutes, I tracked it down to the following section of code:

view plain print about
1<cffunction name="setStartDate" access="public" output="false"

3 <cfargument name="startDate" type="string" required="true" />
4 <cfif isDate( arguments.startDate ) >
5 <cfset setStartDate( arguments.startDate ) /><!--- see this function call? --->
6 <cfelse>
7 <cfset setStartDate( now() ) /><!--- and this one --->
8 </cfif>
9 <cfset variables.instance.startDate = arguments.startDate />
10 </cffunction>

After looking in the code for a little bit I saw my error. The setStartDate() function has setStartDate() inside of it, This was my overly aggressive cut and paste job. Once I rewote the function like I really intended, the error went away....

There are no comments for this entry.

Add Comment Subscribe to Comments