Skip to main content
nikos101
Inspiring
November 19, 2011
Question

How to send a null date to <cfqueryparam and avoid NullPointerException

  • November 19, 2011
  • 1 reply
  • 2111 views

how can I avoid the error

faultCode:Server.Processing faultString:'Unable to invoke CFC - The cause of this output exception was that: java.lang.NullPointerException.' faultDetail:''

when I send a null date to

,<cfqueryparam cfsqltype="cf_sql_timestamp"   value="#ARGUMENTS.object.dateAcknowledged#" null="#isNull(ARGUMENTS.object.dateAcknowledged)#">

    This topic has been closed for replies.

    1 reply

    Inspiring
    November 19, 2011

    Try replacing this:

    null="#isNull(ARGUMENTS.object.dateAcknowledged)#

    with something like this

    null="#not isDate(ARGUMENTS.object.dateAcknowledged)#

    nikos101
    nikos101Author
    Inspiring
    November 19, 2011

    thx, but

    its not valid cfxml

    The CFML compiler was processing:<ul><li>The tag attribute cf_sql_timestamp,

    Inspiring
    November 19, 2011

    Back up a bit.  The objective is to come up with a function that looks at arguments.object.dateacknowledged and returns either true or false, right?  That being the case, cfdump and cfabort are your freinds.  See what isDefined, isDate, StructkeyExists, etc return when you do and don't have a value in that structure.