Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Catching java.lang.NullPointerException with cftry/cfcatch?

Engaged ,
Mar 30, 2009 Mar 30, 2009
I'm getting a java.lang.NullPointerException returned on an update function in a CFC:
"The cause of this output exception was that: java.lang.NullPointerException."

I want to find where it's generating this error so I can fix it. I've never really used CFTRY and CFCATCH, but figured now would be a good time to learn if this helped me track down the null. Can anyone provide an example of how to use these tags with the above NPE and output a message that give info on where it's faulting?

I'm using a standard update query,
<cfquery>
UPDATE table
SET columns = new values
WHERE ID column = some ID
</cfquery>
1.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Mar 30, 2009 Mar 30, 2009
In your cfcatch block of code, mail yourself a cfdump of the cfcatch structure.
Translate
LEGEND ,
Mar 30, 2009 Mar 30, 2009
In your cfcatch block of code, mail yourself a cfdump of the cfcatch structure.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 30, 2009 Mar 30, 2009
LATEST
That was a great tip Dan. Helped me find the line. Apparently a datatype "date" was given an incorrect null value. I figured the problem and the update works now :)

Here's code incase someone wants to know:
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources