Copy link to clipboard
Copied
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
I could reproduce it as well.
(My set-up: ColdFusion 2021 Update 2, running on JDK 11.0.13)
Copy link to clipboard
Copied
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:
Copy link to clipboard
Copied
I have reported a bug: https://tracker.adobe.com/#/view/CF-4212570
Copy link to clipboard
Copied
[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
Copy link to clipboard
Copied
Please beware!!! DON'T click on the link (hf202100-4222222.txt) in the previous post. I have reported it to the moderator. It looks suspiciously like a link to malware.
Copy link to clipboard
Copied
Please download the attached file and rename it as hf202100-4222222.jar, place it at \ColdFusion2021\cfusion\lib\updates folder and restart the CF service. Run the test again.
I dont think its a malware - This is info we got from support.
Copy link to clipboard
Copied
@BKBK The link is safe to use. This was the hotfix shared by our team.
However, we don't want our user to start sharing this in public platform without checking with us. I am going to remove this attachment from above comment.
Copy link to clipboard
Copied
@BKBK The link is safe to use. This was the hotfix shared by our team.
However, we don't want our user to start sharing this in public platform without checking with us. I am going to remove this attachment from above comment.
By @Priyank Shrivastava.
Thanks for confirming, @Priyank Shrivastava.
Better safe than sorry. 😉