Could not find the ColdFusion component or interface query

686 views Asked by At

I restarted my CF2018 server using CommandBox, and I guess none of my previous settings were saved. I've tried everything I can think of, but can't get past this error:

Could not find the ColdFusion component or interface query.

var config_qry = new Query(datasource = this.dsn); //hitting error on this line

config_qry.setSQL('UPDATE t_table SET col1 = cast(:newConfig as json) WHERE default_url like :default_url');

I am pretty sure it's a setting in my CFAdmin that's incorrect, but can't pinpoint what it could be. I've verified that the DSN is working and that's not a problem. It seems to be that the keyword "Query" is not being recognized as a coldfusion word, so it's looking for a component with that name. If I simplify it and try it this way, I'm getting the same error.

var config_qry = new Query();

I'm not sure what else to try. Thank you for the help!

1

There are 1 answers

0
SOS On

Query.cfc is one of several Adobe components that gets loaded from the {cf_root_path}\cfusion\CustomTags directory. Look in CF Admin => Extensions => Custom Tag Paths => Current Custom Tag Paths and see if that path exists. If not, try adding it. To find the root path for your CommandBox install, output:

<cfdump var="#server.coldfusion.rootdir#">

Also as @AndreasRu mentioned in the comments you might consider switching to QueryExecute instead. See this old blog entry for a few of the advantages over Query.cfc.