Skip to main content
March 21, 2016
Answered

Could not find the ColdFusion component or interface secure.common.getreqstatus

  • March 21, 2016
  • 2 replies
  • 9945 views

I had a similar problem about a year ago (Re: It used to work and now it doesn't).   The quick and dirty solution was to create the secure.common directory in the calling directory.   This time, that doesn't work.  I am at a loss as to what to do.  I am running CF10 on a Windows Server 2008.

This topic has been closed for replies.
Correct answer Carl Von Stetten

Yes.  In several attempts, I changed this.datasource to datasource and finally to the actually database name.  Sorry about that.


OK.  But it makes it really hard for anyone to help when the code is a moving target...

I have to dash to a meeting right now, but I'll try to jump back in in an hour or so.

2 replies

March 23, 2016

Something strange is going on.   I was looking for the places where the datasource was spelled out.  The only place was in application.cfc.  I changed it and the CF trace displayed the correct database when I log into the application.  However, when I select an option, the queries in the trace show the previous database.  I cleared cache, but nothing fixes it unless I go into the .cfm file (for the option) and change all references of #datasource# to the actual literal database name.  When I do that, it shows up correctly.  The assignment in application.cfc is:

<cfset this.datasource="MyDatabase">

Thanx.

WolfShade
Legend
March 23, 2016

Change all references to #this.datasource# instead of #datasource#.  According to this SO post, THIS is not included in the automatic order of scope search when looking for a variable.

And honestly, something like that should be in the request scope, anyway, IMHO.

HTH,

^_^

April 1, 2016

I changed all the instances of #datasource# to #this.datasource" .  The CF server had its scheduled reboot last night.  This morning I get: "Element DATASOURCE is undefined in THIS."  Application.cfc has this: <cfset this.datasource="MyDB">

What am I doing wrong?

WolfShade
Legend
March 21, 2016

Do you have a "this.mapping" set in application.cfc that points to /secure as the location of components?

this.mapping["/secure"] = ExpandPath('/') & "/secure";

reqstatus = createObject("component","secure.common").getreqstatus();

HTH,

^_^

March 21, 2016

I am a CF novice, but it appears they do that for the root directory/secure in application.cfc    The more detailed createObject is in each place where the routine is called.   I hope that answers your question.

WolfShade
Legend
March 21, 2016

Hmmm.. well.. it's a Windows server.. when was the last time it was rebooted?  Let it run too long and buffers can fill or become corrupt, certain files can become so fragmented that the computer spends more time seeking data than actually using it.

Just a thought.

V/r,

^_^