Friday, September 01, 2006

ColdFusion - Crazy Error

While coding today, I received the following error:
"The system has attempted to use an undefined value, which usually indicates a programming error, either in your code or some system code. Null Pointers are another name for undefined values."
After my initial bafflement, it occurred to me that the problem wasn't where it was saying it was, in a call to the CFC, but rather in the CFC function itself. I had specified a function returntype of "numeric", but had neglected to setup to return anything at all. Even when I modified the call to the function to not accept a return, as in:
myFunctionCall(parm1=value1, parm2=value2) ;
instead of
myRetVal = myFunctionCall(parm1=value1, parm2=value2) ;

... it still didn't work and threw the same error.

Hopefully, if you're having this problem, and search on some of that text, you'll end up here with a search and save yourself some headache!

Will Belden
September 1st, 2006


Anonymous said...

thank you. I spent hours looking for this error. From what I could tell, the error occured somewhere after the last statement of the cffunction, and before going back to the calling function. It was right under my nose.

Will Belden said...

Glad I could help! - WB

Steve Logan said...

I'm having the same issue now with a site. I've dumbed it down to the most basic code:




Steve Logan said...

ok - posting code didn't work.

anyway, test.cfm:

(cfinvoke component="com.testCFC" method="myFunction" returnvariable="myResult" myArgument="ThisAgument")

and the testCFC is basically what Dreamweaver spits out as the default code for a cfc file.

Will Belden said...

@Steve, Sorry, wasn't clear if you were asking for help or had solved it already. Also, you're still using Dreamweaver? Get on the Eclipse bandwagon...we've got room for ya!

dwkd said...

I've experienced this error after upgrading MySQL from 4 to 5

I've put together this small article on how to temporarily fix it until a hot fix is released from Adobe:

Read here

I hope it helps

Will Belden said...

@dwdk I think the error I received at the time was for a different reason. But good cross-referencing for others who might be getting that error for another cause.