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

Coldfusion command line

New Here ,
Nov 19, 2021 Nov 19, 2021

Copy link to clipboard

Copied

 

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" });

Views

237

Translate

Translate

Report

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
Community Expert ,
Nov 19, 2021 Nov 19, 2021

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. 


/Charlie (troubleshooter, carehart.org)

Votes

Translate

Translate

Report

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
Community Expert ,
Nov 20, 2021 Nov 20, 2021

Copy link to clipboard

Copied

I could reproduce it as well. 

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

BKBK_0-1637410098783.png

 

 

 

Votes

Translate

Translate

Report

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
Community Expert ,
Nov 20, 2021 Nov 20, 2021

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:

BKBK_0-1637411213915.png

 

Votes

Translate

Translate

Report

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
Community Expert ,
Nov 21, 2021 Nov 21, 2021

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

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
New Here ,
Dec 07, 2021 Dec 07, 2021

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

Votes

Translate

Translate

Report

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
Community Expert ,
Dec 07, 2021 Dec 07, 2021

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.

Votes

Translate

Translate

Report

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
New Here ,
Dec 07, 2021 Dec 07, 2021

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.

Votes

Translate

Translate

Report

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
Adobe Employee ,
Dec 07, 2021 Dec 07, 2021

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. 

 

Thanks,
Priyank Shrivastava

Votes

Translate

Translate

Report

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
Community Expert ,
Dec 08, 2021 Dec 08, 2021

Copy link to clipboard

Copied

LATEST
quote

@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. 😉

 

Votes

Translate

Translate

Report

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
Documentation