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

The getBuiltInScopes method was not found

Participant ,
Sep 25, 2014 Sep 25, 2014

Copy link to clipboard

Copied

  I have an application that has worked for quite a while. I have made no changes to the code since the last time I used it. Basically, the code creates a zip file with input for an involved report. I used it in March of this year it worked fine. I've been assured by the gov't sysadmins and DBAs that nothing has changed, but I still get the attached error. Any ideas?    I have just heard from a friend who knows CF, that it could be a version issue.  I am currently running 8 and I believe he is running 10.   If this is an issue, is the solution somewhere on this site?   I do minimal CF and am at a loss.   The function that is throwing the error is when a button is clicked, a javascript routine is run which combines all the files requred for the zip file.   Yesterday, another application started throwing the error.  I haven't been through the code yet, but it is another button being clicked, and I'm sure, another javascript error.

Views

3.0K

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

correct answers 1 Correct answer

Participant , Oct 07, 2014 Oct 07, 2014

getBultInScopes() is a ColdFusion 8  procedure...   getCFScopes() is the current call.   My problem was, there was a special debug module that had the call and I could find it nowhere else.  Finally refreshed my Application.cfc from Production and found a call to getBuiltInScopes() there that wasn't in the module I had.   Commented that section out and the error disappeared.  Thank you all for your assistance.

Votes

Translate

Translate
Participant ,
Sep 30, 2014 Sep 30, 2014

Copy link to clipboard

Copied

I just commented it out and moved it up for the SysAdmin to move.   I asked him to clear cache again... if that doesn't do anything, I'll request another restart in the morning.

Best practice... I'm sure it's not.  I know very little CF and less Java...  I am trying to get someone in here (my work)  that knows more than I do to review this code and tell me what needs to be fixed.

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
Engaged ,
Sep 26, 2014 Sep 26, 2014

Copy link to clipboard

Copied

My guess is that your production server has template cache enabled.  So, your change and production deploy won't be seen until you go into the ColdFusion administrator and clear the cache.  Alternatively, you could just restart CF.

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
Participant ,
Sep 30, 2014 Sep 30, 2014

Copy link to clipboard

Copied

Since I have discovered (for my own knowledge) getBuiltInScopes() vs getCFScopes()...   is there anything else like that out there?   The application I inherited, was written with ColdFusion 8 and the Production server is now up to CF10.    A bunch of errors, similar to this, have popped up recently without me doing anything to the code.  I am assuming the SysAdmin on the production system did an update or patch and some of this older stuff is not compatible...   I really need to solve this error and any other related.   Thank you.

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 ,
Oct 01, 2014 Oct 01, 2014

Copy link to clipboard

Copied

Your concerns are justified. The issue may turn out to have consequences. The error stops Coldfusion processing the page further. However, the user who pressed on the button to approve or disapprove apparently did so for a reason.

Bring any errors you may have to the forum. We shall be glad to discuss them with you. Good luck.

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
Participant ,
Oct 01, 2014 Oct 01, 2014

Copy link to clipboard

Copied

Indeed.  They use this to approve or disapprove a request.  Now they have a work stoppage and I have no idea how to fix it.    The reboot after the commenting the code out in the ONLY place the getBuiltInScopes is listed in the entire application, did nothing.  I still get the same error.   How can the getBuiltInScopes error still show up if I changed it to getCFScopes and then finally, commented it out?  This is truly maddening.

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 ,
Oct 01, 2014 Oct 01, 2014

Copy link to clipboard

Copied

Sorry to hear that, LouieWarren. There is every likelihood that the code getPageContext().getBuiltInScopes() is still active.


Given the changes you have already made, there is a quick test we can do. Open the file C:\ColdFusion8\logs\Exception.log in a text editor.


Locate the error in the text, and all the information that immediately follows. Copy-paste the stack trace (that is, all the information pertaining to the error) and send it to me by private message. 

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
Participant ,
Oct 01, 2014 Oct 01, 2014

Copy link to clipboard

Copied

The Production server is at the customer site.   I do not have access to it.   I will see if the SysAdmin can send me the log, but they are at CF10.

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 ,
Oct 01, 2014 Oct 01, 2014

Copy link to clipboard

Copied

You have my sympathy. I have had to play this wait-for-em-to-pass-the-parcel game myself. Excruciating, sometimes.

The location of the file on CF10 is CF_installation_directory/cfusion/logs/Exception.log (making allowances for Windows or Linux). Let us hope they share your sense of urgency.


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
Participant ,
Oct 01, 2014 Oct 01, 2014

Copy link to clipboard

Copied

He's already refused to reboot/refresh cache for me again after last night.   He says he has 20 other CF users on that box and no one asks for such things.   My customer is going bats*** and being a CF/Java novice, it's really frustrating.  If I didn't have the help that you've provided, I don't know what I would have done.  Thank you.

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
Engaged ,
Oct 01, 2014 Oct 01, 2014

Copy link to clipboard

Copied

Said it before.. I'll say it again.  There is some form of caching going on that is causing your issue.  If you have indeed removed the code and pushed it into production then the problem is on the server.  They more than likely have save class files enabled so even if they restart or clear cache the files will remain.  They can safely delete the files without restarting CF to clear them.

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
Participant ,
Oct 01, 2014 Oct 01, 2014

Copy link to clipboard

Copied

Sorry to be dense, but what would I tell them to delete?

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
Engaged ,
Oct 01, 2014 Oct 01, 2014

Copy link to clipboard

Copied

Just delete all the files in the cfclasses folder that is in {cfhome}/cfusion/wwwroot/WEB-INF/cfclasses/

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
Participant ,
Oct 01, 2014 Oct 01, 2014

Copy link to clipboard

Copied

Doubt they'll do that, but I will try.  Thank you.

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
Participant ,
Oct 01, 2014 Oct 01, 2014

Copy link to clipboard

Copied

As suspected, they won't do it.   To quote him:

"I don't know the effect of deleting the class files so I will not delete the class file." 

I doubt I can convince him otherwise.  They have 20 other customers on that box and I'm just one little application.  Do these file expire and go away?  I doubt they have set up unlimited space to store them.

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
Participant ,
Oct 01, 2014 Oct 01, 2014

Copy link to clipboard

Copied

Is there anything else I can do, to the code, or anything in my control, to figure out what is up?   I am once again, stumped.  My CF skills are a bit more than regular HTML...  I use Expression Web 4 to check the code and may not always follow things correctly. There are numerous calls to getPageContext(), but only one to getBuiltInScopes (or the replacement getCFScopes), would tracing down each call help any?   It's severely frustrating when you are "in charge" of something, but have to depend on someone else because policy says you can't touch it.  

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 ,
Oct 02, 2014 Oct 02, 2014

Copy link to clipboard

Copied

1) Confirm that all parties are using exactly the same copy of the Coldfusion code.

2) Copy the entire code into a directory, say, testDir.

3) Install a search tool, like Wingrep, and use it to search testDir for the string getBuiltInScopes. 

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
Participant ,
Oct 02, 2014 Oct 02, 2014

Copy link to clipboard

Copied

I am the starting point for all code for this application.   When I took over, I copied everything on the FTP site (Test & Production are copies of this) to my laptop.  I have done AstroGrep searching for getBuiltInScopes and found the one instance.  I changed it to getCFScopes()... no change.   I commented it out... no change.   Will WinGrep give me different results?  Thanx.

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 ,
Oct 02, 2014 Oct 02, 2014

Copy link to clipboard

Copied

LouieWarren wrote:

I am the starting point for all code for this application.   When I took over, I copied everything on the FTP site (Test & Production are copies of this) to my laptop.  I have done AstroGrep searching for getBuiltInScopes and found the one instance.  I changed it to getCFScopes()... no change.   I commented it out... no change.

The great fictional detective, Sherlock Holmes, said, "When you have eliminated the impossible, whatever remains, however improbable, must be the truth". This leaves us with one option that has made the rounds before. The inevitable conclusion is that, each time you make a change, the code that Coldfusion runs is different from the one you have modified.

We have mentioned caching as a possible cause. Another common source of error is saving the edited file with the wrong extension, usually as TXT instead of CFM or CFC.

There is a test you could do that is less drastic than clearing the class files. At least, it sounds less drastic. In Application.cfc, temporarily change the name of the application.

You can do it as follows. Locate the line that is equivalent to

this.name = "someName"

Change that to

this.name = "someName2"

The new name will force Coldfusion to compile the files into new classes. However, beware! Doing this will reset your whole application, ending current sessions and starting new ones. So, I would highly recommend you do it on a test server, not on production.

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
Participant ,
Oct 02, 2014 Oct 02, 2014

Copy link to clipboard

Copied

Well, now I've screwed it up.   Production is the only place it was happening.  My customer isn't savvy enough to recreate the issue on Test and neither am I.  I changed the name, as mentioned, and moved the file over.  Well, for the 1st time since I've been here, it appears I had to change the datasource.  Never done it.  I assumed the SysAdmin did it.   Now my application is hosed because it's looking for test.  I changed the datasource and he moved it over again, but it didn't work.   I'm having him restore the file from back up to the way it was this morning before I did this.   I really hate this crap.  Yes, I know you warned me.

Now that I've calmed down slightly...  since the this.name line is above the datasource line, the reset should have happened. or would it have to have completely loaded?  Just anticipating my next move when they restore Application.cfc from the last backup.  It hadn't been changed since 2013, so it should be the same as it was.   Just like cellophane toilet paper...   it may do the job, but makes a bigger mess in the process.

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
Participant ,
Oct 02, 2014 Oct 02, 2014

Copy link to clipboard

Copied

Well, the file was restored and the error is back as it was.   I am having them get me a copy of the file so I can compare to what I uploaded...   Insanity...

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
Participant ,
Oct 02, 2014 Oct 02, 2014

Copy link to clipboard

Copied

Found this: http://www.bennadel.com/blog/673-force-coldfusion-server-to-recompile-a-coldfusion-template.htm

Basically it says I can add comments or something to the checkall.cfm file that contained the original getBuiltInScopes error and it will do what you described I do in Application.cfc?   Maybe I'm reading what I want to hear.  The two application files (my copy and the actual one on Production) are so different, I don't know, quickly, what to do.    More confused than ever.

While trying to solve the Application.cfc problem...  I have <cfset datasource=#application.datasource#>    Where is #application.datasource#  set?  I can't find it.   I see the cfset datasource but don't see where the other variable is queried and set.   I told you I was a novice.

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
Participant ,
Oct 02, 2014 Oct 02, 2014

Copy link to clipboard

Copied

In the Application.cfc from Production, I think I've found my problem....

<cfset allScopes = getPageContext().getBuiltInScopes()/>

            <cfloop list="#structKeyList(allscopes)#" index="k">

            <cfif k IS NOT 'variables'>

                     <cfoutput>    <h4>#k#</h4></cfoutput>

                    <cfdump var="#allscopes#" format="text" />

            </cfif>

This is not in the copy I have.  Should I comment this out, or change getBuiltInScopes() to getCFScopes() and promote that to Production?   There may be hope yet.

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 ,
Oct 02, 2014 Oct 02, 2014

Copy link to clipboard

Copied

That's the one! I will stick to my original advice. No output or dump in Application.cfc. So I would suggest you comment that line out as well as the loop code. You should have at least one phase between changed code and production, namely, test.

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
Participant ,
Oct 02, 2014 Oct 02, 2014

Copy link to clipboard

Copied

So, change the getBuiltInScopes() to getCFScopes()...   could the phrase be a comment saying what I had to do, or are you saying I need something else?

Obviously not: I checked it on Test and got this:

You have attempted to dereference a scalar variable of type class [Lcoldfusion.runtime.Scope; as a structure with members.

The error occurred in //xxxxx002/TestProdMX/Sites/XXX/IE/XXXX/secure/Application.cfc: line 115

113 :             <!-- 141002 - changed getBuiltInScopes() from CF8 to getCFScopes() from CF10  LSW ------>

114 :             <cfset allScopes = getPageContext().getCFScopes()/>

115 :             <cfloop list="#structKeyList(allscopes)#" index="k">

116 :             <cfif k IS NOT 'variables'>

117 :                      <cfoutput>    <h4>#k#</h4></cfoutput>

Good thing I checked before I had it promoted.   Obviously, that doesn't work.

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 ,
Oct 02, 2014 Oct 02, 2014

Copy link to clipboard

Copied

Indeed, I expected problems and changed my suggestion accordingly. The code now fails because the functionality of getCFScopes is slightly different from that of getBuiltInScopes.

I have tested it myself, and know how to correct it. However, as I said earlier, it is inadvisable to do output in Application.cfc. Besides, this particular code block apparently contributes nothing to the business code.

Comment that line out, as well as the loop that immediately follows it. Something like

  <!--- 141002 - changed getBuiltInScopes() from CF8 to getCFScopes() from CF10  LSW ------>

  <!---

<cfset allScopes = getPageContext().getCFScopes()/>

<cfloop list="#structKeyList(allscopes)#" index="k">

<cfif k IS NOT 'variables'>

<cfoutput>    <h4>#k#</h4></cfoutput>

etc.

</cfloop>

--->

Note the 3 hyphens (not 2) in the comment start-tag just before 141002.

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