Skip navigation
Currently Being Moderated

Output exception NullPointer Exception

Jun 17, 2012 8:55 PM

Hi all

I get this error when updating a record:

 

The cause of this output exception was that: java.lang.NullPointerException.

78 :    MEETING= <cfqueryparam cfsqltype="cf_sql_timestamp" value="#meetingDate#" />

 

 

This is the code that sets the meetingDate:

 

<cfset meetingDate = trim(form.meeting)>

<cfif not isDate(meetingDate)>

<cfelseif DayOfWeek(Now()) eq 5>

<cfset meetingDate = dateAdd("d", 4, now())>

<cfelseif DayOfWeek(Now()) eq 1>

<cfset meetingDate = dateAdd("d", 3, now())>

<cfelse>

<cfset meetingDate = dateAdd("d", 2, now())>

</cfif>

 

 

It works when I use this code, but I am using some more conditions now:

 

<cfset meetingDate = trim(form.meeting)>

<cfif not isDate(meetingDate)>

<cfset meetingDate = dateAdd("d", 2, now())>

</cfif>

 

Why does it throw the java error? Thank you

 
Replies
  • Currently Being Moderated
    Jun 18, 2012 4:55 AM   in reply to goodychurro1

    When in doubt, look at your data.  What is the value of form.meeting?  What is the value of meetingDate after the block of code?

     

    I suggest outputting bits of text after each if, elseif, and else tag so you can see which ones return true.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 20, 2012 4:56 AM   in reply to goodychurro1

    If you have all that stuff working correctly, leave it and check to see if your meetingDate is a holiday afterwards.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points