Skip to main content
New Participant
November 19, 2021
Question

Coldfusion command line

  • November 19, 2021
  • 2 replies
  • 810 views

 

Hello,

 

while running below command - getting error - “java.lang.NullPointerException” 

Please see attachment of screenshot

 

queryExecute ("SELECT * FROM test WHERE id = :id", { id=1, cfsqltype="cf_sql_integer" },{ datasource="creditapp" });

    This topic has been closed for replies.

    2 replies

    BKBK
    Community Expert
    November 20, 2021

    I could reproduce it as well. 

    (My set-up: ColdFusion 2021 Update 2, running on JDK 11.0.13)

     

     

     

    BKBK
    Community Expert
    November 20, 2021

    Yet another CLI/REPL test that results in a NullPointerException:

    /* Application.cfc located in same directory as test15.cfm */
    component {
        this.name = "AppName";
        this.datasource = "cfml_db";
        this.sessionManagement = true;
    
        boolean function onApplicationStart() {
           return true;
        }
    
     }
    
    <1--- test15.cfm --->
    <cfscript>
    	x=queryExecute ("SELECT * FROM animals WHERE id = :id", { id=1, cfsqltype="cf_sql_integer" },{ datasource="cfmx_db" });
    	writedump(x);
    </cfscript>
    
    

     

    CLI result:

     

    New Participant
    December 7, 2021

    I have reported a bug: https://tracker.adobe.com/#/view/CF-4212570 


    [Link Removed]

     

     

    We were provided with above pathc - Could you please try this patch - We have applied but it didnt work for us - updated support with same details

    Charlie Arehart
    Community Expert
    November 19, 2021

    Have you confirmed first that a simple single variable assignment works? How about a simpler sql statement, without the queryparam?

     

    And what cf version are you running? And what update level? That will help folks see if they get the same problem. (Of course, they'd not have your database.)

     

    I'll assume also that the dsn you name is defined in the cf admin of the instance whose CLI you're running. Have you confirmed also that just running that code in a cfscript block of a regular cfm page (requested by a browser or the cf.bat file) does work?

     

    Breaking your problem into pieces is the way to solve things like this, which you think "should just work". Only after exhausting such possibilities might it be time to wonder if there's a bug in cf. 

    /Charlie (troubleshooter, carehart. org)