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

Randomly getting entity has incorrect type for being called as a function

New Here ,
Apr 03, 2011 Apr 03, 2011

I have a good sized cfc with several functions in it, I am going through and trying to re-code it some so that it does not include cfobject's that refer to itself.

For example making a cfobject of the cfc as "Mainfunctions" and then calling functions such as cfset x=MainFunctions.MakeRandomString(Length=5)

I want to just do cfset x=MakeRandomString(Length=5)

Now the problem I am having is that I go through and make the rewrites and test it and it works fine, and then periodically I get a random error telling me

"Entity has incorrect type for being called as a function. The symbol you provided MyFunctionName is not the name of a function"

However testing it on the exact same page, with the exact same parameters it will work perfectly fine.

I am testing this on CF9, I have scoped out all the variables I can find, defining them at the start of the function using var.variablename and referencing the function arguments with arguments.ArgumentName

I am completely baffled as to why this is happening and appreciate any suggestions.

Thanks,

5.1K
Translate
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
LEGEND ,
Apr 03, 2011 Apr 03, 2011

Check where you are calling it from.  What you are describing could occur if the function is further down in the code from the line calling it.

Translate
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 ,
Apr 03, 2011 Apr 03, 2011

So if I understand you correctly, if I have a cfc kinda like this:

cffunction name="x"

code for function x

end cffunction

cffunction name="y"

some code

cfset abc=z(param)

end cffunction

cffcuntion name="z"

some code

end cffunction

Then I must put function Y to be after Z to prevent the issue. If so then I don't think I can call any functions directly by name then reliably and must always create a cfobject within the cfc just to call the functions within it.

Translate
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
LEGEND ,
Apr 04, 2011 Apr 04, 2011

Nonsense.  The file is compiled before it's executed, so the runtime knows about all the methods or functions within a template well before an individual line of code is executed.

--

Adam

Translate
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 ,
Apr 04, 2011 Apr 04, 2011

That's what I thought as well.

Then does anyone have any other suggestions as to why this error would occur at random?

I have been focusing on converting this one function to have everything properly scoped, but if the other functions are not would it cause it? But then why does calling the function in the style of MainFunctions.MyFunctionName(Param1=var.paramvalue) work fine all the time but MyFunctionName(Param1=var.paramvalue) fails at random.

Translate
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
LEGEND ,
Apr 04, 2011 Apr 04, 2011

An obvious demonstration of this being nonsense is this:

<cfoutput>#foo()#</cfoutput>

<cffunction name="foo">
    <cfreturn "bar">
</cffunction>


Works fine.

A good demonstration of the fact the functions are handled at compile time, rather than at runtime is this:

<cfoutput>#foo()#</cfoutput>

<cffunction name="foo">
    <cfreturn "bar">
</cffunction>

<cffunction name="foo">
    <cfreturn "bar">
</cffunction>

This will error, but note it's a compilation error, not a runtime error.

So before the code is executed, CF knows about all the functions within a template.

--

Adam

Translate
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
LEGEND ,
Apr 04, 2011 Apr 04, 2011

It sounds to me like you're not VARing your function-local variables, and you've got a variable name that is the same as one of your method names.

If you don't VAR your variables (which you should always do, unless there's a specific reason to want something not VARed), then the variable will be created in the variables scope, which is where public methods are.  And because method names are just variables like any other variable, you can easily overwrite them.

If you have this (let's see if the forums allow me to paste in code today):

<cffunction name="getStuff" returntype="query">
    <cfquery name="getStuff">
        <!--- some SQL --->
    </cfquery>
</cffunction>

Then you will overwrite the function getStuff with the query named getStuff.  I see this sort of thing (once) all the time.  You need to VAR the query variable:

<cffunction name="getStuff" returntype="query">
    <cfset VAR getStuff = "">
    <cfquery name="getStuff">
        <!--- some SQL --->
    </cfquery>
</cffunction>

Also... now I'm not saying this is exactly what you're doing, but it's seldom sensible to have a recordset name the same as the method name anyhow.  "getStuff" is not a meaningful name for a recordset... the recordset is the stuff, it's not the thing that gets it.  In this case it should probably best be called "stuff", eg:

<cfset VAR stuff = "">

<cfquery name="stuff">

Poor naming policies like the above help create these situations, although the VARing (or lack-thereof) is the actual problem here.

--

Adam

Translate
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 ,
Apr 04, 2011 Apr 04, 2011

I had thought that as well when I saw the bug, I looked throughout the function itself and could not find the same name as the function I was calling being used as a variable of any sort. I was just thinking about it and even did a full search throughout the function file itself for "GetUserInformation" which is the function name. It only shows up as functions and never as a variable, query, or parameter.

Since the function is within the same cfc, would it be a good idea to use this.GetUserInformation to call the function or would that possibly cause an issue down the road that I am missing, or is it just that I need to go through and convert every function to be fully scoped now (Which I will do, but I want to take these on one at a time)?

Translate
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
LEGEND ,
Apr 04, 2011 Apr 04, 2011

Can you reliably replicate this?  It sounds perhaps like you can't.

If you CAN, put a try/catch around the erroring call, and dump out the "function" to see what value it now holds.  That might give you a clue as to where it's being changed.

The only time I specifically use the THIS scope in a CFC is to set public properties, which we do in some very specific situations.  I'd never use it to qualify a function call, no.  I don't see that it serves any useful purpose.

I might have to recant my earlier statement... using an unVARed variable might overwrite a PRIVATE method, but it should not overwrite a PUBLIC one (which are in the this scope).  Not in a position to test this just now, as only have a 5min break... not enough time to knock some code together.  Will look @ it in more depth this evening, if I have a chance.

--
Adam

Translate
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 ,
Apr 04, 2011 Apr 04, 2011

Making it reliably do it is a bit hard. I can put the code out there and it will run fine for hundreds of requests with no errors, and then it just throws one out there.

I like the idea of using the cftry on it, I'll throw it in there a little bit later this afternoon and give it a shot. I'll have it email me the contents of the cfdump.

I never tried using cfdump on a function before, but it sounds like a solid plan.

Yes these functions are all public as they are intended to be used throughout the site, and will eventually be turned into remote access functions (Minus a couple).

I'll try it in a bit when the phone calls settle down today and let you know of my results.

Translate
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 ,
Apr 04, 2011 Apr 04, 2011

Ok now this is weird...

I did the cftry and catch as you suggested and it took awhile but it finally had the "error". I had tried the cfdump on a function just to see what I would get as output, and as I expected it gave me the arguments, returntype, access, etc.

The weird part, is when this error is happening and I do the CFdump on the Function ie <cfdump var="#GetUserInformation#"> it seems to dump out the cfc itself... Every single function in the MainFunctions cfc. Which even lists the GetUserInformation function.

This totally has me confused now.

Translate
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
LEGEND ,
Apr 04, 2011 Apr 04, 2011

Post the CFC and the instantiation code. It might just need a second (... third... fourth...) pair of eyes on it.

I'm sure there's a good if not immediately obvious explanation.

--

Adam

Translate
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 ,
Apr 05, 2011 Apr 05, 2011

I would post it except two things... most of the code the customer considers "trade secrets", and the entire cfc is about 12,000 lines of code ~500kb in size.

I can post the function itself that is trying to call the function that is causing the problem (GenerateRelatedContent)... see below.

I modified the cfdump to output the contents of the cfcatch, I want to see if maybe it's taking some odd path to processing the tags or might have a little bit more useful details so we all don't go crazy looking at it. I got several emails of it dumping out the same thing when this happens.

I know all you can is make shot in the dark suggestions without seeing all the code, but I can give a bit of it to help shed some light.

What I did is I fully scoped the UserSessionInfo struct inside of the GetUserInformation function to make sure it was'nt trying to call or refer to it outside of itself (I need to do this to everything and it's my little project for tonight). I double checked GetUserInformation to make sure it will return a struct no matter what happens.

The struct I am making in that Function is defined within it like so:

    <cffunction name="GetUserInformation" output="no" returntype="struct" access="public">
        <cfargument name="UserNum" required="no" default="0" type="string">
        <cfargument name="UserSessionInfo" required="no" type="struct">

        <cfset UserResult=StructNew()>
        <cfset UserResult.RecordCount=0>
        <cfset UserResult.UserNum=0>
        <cfset UserResult.Email="">
        <cfset UserResult.Active="">
        <cfset UserResult.DateAdded="">
        <cfset UserResult.Confirmed="0">
        <cfset UserResult.DatabaseNum="">
        <cfset UserResult.StorageServerNum="">
        <cfset UserResult.BirthDay="">
        <cfset UserResult.Gender="">
        <cfset UserResult.Handle="">
        <cfset UserResult.FirstName="">
        <cfset UserResult.LastName="">
        <cfset UserResult.LastLoginDate="">

     ..... logic to validate user and make sure it can access the information .....

          <cfreturn UserResult>

     </cffunction>

The function we are in that is calling that function and is giving us a hissy fit at random is this:

<cffunction name="GenerateRelatedContent" access="public" returntype="any" output="true">
    <cfargument name="RelatedBlockNum1" required="no" default="" type="string">
    <cfargument name="RelatedUserNum1" required="no" default="" type="string">
    <cfargument name="RelatedBlockNum2" required="no" default="" type="string">
    <cfargument name="RelatedUserNum2" required="no" default="" type="string">
    <cfargument name="UserSessionInfo" required="no" type="struct">
   
    <cfset var.SearchContentResultsOne=structnew()>
    <cfset var.SearchContentResultsTwo=structnew()>
    <cfset var.ContentWordResultOne=structnew()>
    <cfset var.ContentWordResultTwo=structnew()>
    <cfset var.UserInfoOne=structnew()>
    <cfset var.UserInfoTwo=structnew()>
    <cfset var.UserOneAvtr=structnew()>
    <cfset var.UserTwoAvtr=structnew()>
    <cfset var.SearchWordOne="">
    <cfset var.SearchWordTwo="">
    <cfset var.WordOneIndex=0>
    <cfset var.WordTwoIndex=0>
    <cfset var.WordOneTries=0>
    <cfset var.WordTwoTries=0>
    <cfset var.FoundGoodWord=0>
    <cfset var.ReadContent=0>
    <cfset var.ReadPermissionName="Read Content">
   
    <cfobject name="MainFunctions" component="/cms/functions">

    <cfset var.ContentWordResultOne=MainFunctions.GetWordCounts(BlockNum=arguments.RelatedBlockNum1,ContentUser=arguments.RelatedUserNum1,ReturnOnlyNounandVerbs=1,UserSessionInfo=arguments.UserSessionInfo)>
    <cfset var.ContentWordResultTwo=MainFunctions.GetWordCounts(BlockNum=arguments.RelatedBlockNum2,ContentUser=arguments.RelatedUserNum2,ReturnOnlyNounandVerbs=1,UserSessionInfo=arguments.UserSessionInfo)>
    <cfset var.WordOneTries=0>
    <cfset var.FoundGoodWord=0>
    <cfif var.ContentWordResultOne.RecordCount GTE 1>
        <cfloop condition="var.FoundGoodWord is 0 AND var.WordOneTries LT 3">
            <cfset var.WordOneIndex=RandRange(1,var.ContentWordResultOne.RecordCount)>
            <cfset var.SearchWordOne=var.ContentWordResultOne.Results[var.WordOneIndex].Word>
            <cfif (var.ContentWordResultOne.Results[var.WordOneIndex].IsNoun is 1 or var.ContentWordResultOne.Results[var.WordOneIndex].IsVerb is 1) and (var.ContentWordResultOne.Results[var.WordOneIndex].IsProfanity is 0 and var.ContentWordResultOne.Results[var.WordOneIndex].IsAWord is 1 and var.ContentWordResultOne.Results[var.WordOneIndex].CanBeRelatedWordOverride NEQ 0)>
                <cfset var.FoundGoodWord=1>
            <cfelse>
                <cfset var.WordOneTries=var.WordOneTries+1>
            </cfif>
        </cfloop>
        <cfif var.WordOneTries LT 3>
            <cfset var.SearchContentResultsOne=MainFunctions.SearchContent(SearchText=var.SearchWordOne,MaxResults=10,EnableTrending=0,UserSessionInfo=arguments.UserSessionInfo)>
            <cfif var.SearchContentResultsOne.recordcount GTE 1>
                <cfset var.SearchOneResultIndex=RandRange(1,var.SearchContentResultsOne.RecordCount)>
                <cftry>
                    <cfset var.UserInfoOne=GetUserInformation(UserNum=var.SearchContentResultsOne.Results[var.SearchOneResultIndex].UserNum,UserSessionInfo=arguments.UserSessionInfo)>
                    <cfcatch>
                        <cfmail server="#MailServerSource#" password="#MailServerPass#" username="#MailServerUser#" to="myemail@address.com" from="serveremail@address.com" subject="GetUserInfo test 1">
                            <cfdump var="#GetUserInformation#">
                           
                            #now()#
                        </cfmail>
                        <cfset var.UserInfoOne=MainFunctions.GetUserInformation(UserNum=var.SearchContentResultsOne.Results[var.SearchOneResultIndex].UserNum,UserSessionInfo=arguments.UserSessionInfo)>
                    </cfcatch>
                </cftry>
            </cfif>
        </cfif>
    </cfif>
    <cfset var.WordTwoTries=0>
    <cfset var.FoundGoodWord=0>
    <cfif var.ContentWordResultTwo.RecordCount GTE 1>
        <cfloop condition="var.FoundGoodWord is 0 AND var.WordTwoTries LT 3">
            <cfset var.WordTwoIndex=RandRange(1,var.ContentWordResultTwo.RecordCount)>
            <cfset var.SearchWordTwo=var.ContentWordResultTwo.Results[var.WordTwoIndex].Word>
            <cfif (var.ContentWordResultTwo.Results[var.WordTwoIndex].IsNoun is 1 or var.ContentWordResultTwo.Results[var.WordTwoIndex].IsVerb is 1) and (var.ContentWordResultTwo.Results[var.WordTwoIndex].IsProfanity is 0 and var.ContentWordResultTwo.Results[var.WordTwoIndex].IsAWord is 1 and var.ContentWordResultTwo.Results[var.WordTwoIndex].CanBeRelatedWordOverride NEQ 0)>
                <cfset var.FoundGoodWord=1>
            <cfelse>
                <cfset var.WordTwoTries=var.WordTwoTries+1>
            </cfif>
        </cfloop>
        <cfif var.WordTwoTries LT 3>
            <cfset var.SearchContentResultsTwo=SearchContent(SearchText=var.SearchWordTwo,MaxResults=10,EnableTrending=0,UserSessionInfo=arguments.UserSessionInfo)>
            <cfif var.SearchContentResultsTwo.recordcount GTE 1>
                <cfset var.SearchTwoResultIndex=RandRange(1,var.SearchContentResultsTwo.RecordCount)>
                <cftry>
                    <cfset var.UserInfoTwo=GetUserInformation(UserNum=var.SearchContentResultsTwo.Results[var.SearchTwoResultIndex].UserNum,UserSessionInfo=arguments.UserSessionInfo)>               
                    <cfcatch>
                        <cfmail server="#MailServerSource#" password="#MailServerPass#" username="#MailServerUser#" to="myemail@address.com" from="serveremail@address.com" subject="GetUserInfo test 2">
                            <cfdump var="#GetUserInformation#">
                           
                            #now()#
                        </cfmail>
                        <cfset var.UserInfoTwo=MainFunctions.GetUserInformation(UserNum=var.SearchContentResultsTwo.Results[var.SearchTwoResultIndex].UserNum,UserSessionInfo=arguments.UserSessionInfo)>
                    </cfcatch>
                </cftry>
            </cfif>
        </cfif>
    </cfif>
    <cfoutput>
      HTML code for displaying an ad would be here
    <cfif var.WordOneTries LT 3>
        <cfif var.ContentWordResultOne.RecordCount GTE 1>
            <cfif var.SearchContentResultsOne.RecordCount GTE 1 >
                <cfobject name="CheckContentPermission" component="functions">
                    <cfinvoke component="functions" returnvariable="var.ReadContent" method="CheckContentPermission">
                    <cfinvokeargument name="ContentUser" value="#var.SearchContentResultsOne.Results[var.SearchOneResultIndex].UserNum#">
                    <cfinvokeargument name="BlockNum" value="#var.SearchContentResultsOne.Results[var.SearchOneResultIndex].BlockNum#">
                    <cfinvokeargument name="PermissionName" value="#var.ReadPermissionName#">
                    <cfinvokeargument name="UserSessionInfo" value="#arguments.UserSessionInfo#">
                </cfinvoke>
                <cfif var.ReadContent is 1>
                    <cfif arguments.UserSessionInfo.SessionUserNum NEQ var.UserInfoOne.UserNum>
                            <cfset var.UserOneAvtr=MainFunctions.GetUserField(UserNum=var.UserInfoOne.UserNum,FieldName="avtr",UserSessionInfo=arguments.UserSessionInfo)>
                               HTML Code for displaying what the related content block is goes here
                    </cfif>
                </cfif>
            </cfif>
        </cfif>
    </cfif>

     HTML Code for displaying an ad would be here

    <cfif var.WordTwoTries LT 3>
        <cfif var.ContentWordResultTwo.RecordCount GTE 1>
            <cfif var.SearchContentResultsTwo.RecordCount GTE 1>
                <cfobject name="CheckContentPermission" component="functions">
                    <cfinvoke component="functions" returnvariable="var.ReadContent" method="CheckContentPermission">
                    <cfinvokeargument name="ContentUser" value="#var.SearchContentResultsTwo.Results[var.SearchTwoResultIndex].UserNum#">
                    <cfinvokeargument name="BlockNum" value="#var.SearchContentResultsTwo.Results[var.SearchTwoResultIndex].BlockNum#">
                    <cfinvokeargument name="PermissionName" value="#var.ReadPermissionName#">
                    <cfinvokeargument name="UserSessionInfo" value="#arguments.UserSessionInfo#">
                </cfinvoke>
                <cfif var.ReadContent is 1>
                    <cfif arguments.UserSessionInfo.SessionUserNum NEQ var.UserInfoTwo.UserNum>
                            <cfset var.UserTwoAvtr=MainFunctions.GetUserField(UserNum=var.UserInfoTwo.UserNum,FieldName="avtr",UserSessionInfo=arguments.UserSessionInfo)>
                            HTML Code for displaying what the related content block is goes here
                    </cfif>
                </cfif>
            </cfif>
        </cfif>
    </cfif>
    </cfoutput>

</cffunction>

Translate
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
LEGEND ,
Apr 05, 2011 Apr 05, 2011

OK, that's a fair bit to wade through.  I'll look @ it this evening.

--
Adam

Translate
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 ,
Apr 05, 2011 Apr 05, 2011

When I used <cfdump var="#Cfcatch#"> it gave me the following as the trace:

coldfusion.runtime.CfJspPage$UninvocableEntityException: Entity has incorrect type for being called as a function.      at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2552)      at cffunctions2ecfc992514771$funcGENERATERELATEDCONTENT.runFunction(E:\site\cms\functions.cfc:4243)      at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)      at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)      at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)      at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)      at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)      at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:517)      at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:495)      at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:354)      at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2301)      at cfprofile2ecfm1288964857._factor25(E:\site\profile.cfm:840)      at cfprofile2ecfm1288964857._factor26(E:\site\profile.cfm:727)      at cfprofile2ecfm1288964857._factor27(E:\site\profile.cfm:726)      at cfprofile2ecfm1288964857._factor28(E:\site\profile.cfm:725)      at cfprofile2ecfm1288964857._factor30(E:\site\profile.cfm:419)      at cfprofile2ecfm1288964857.runPage(E:\site\profile.cfm:1)      at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231)      at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416)      at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)      at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:363)      at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)      at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)      at coldfusion.filter.PathFilter.invoke(PathFilter.java:87)      at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)      at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)      at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)      at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)      at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)      at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)      at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:53)      at coldfusion.CfmServlet.service(CfmServlet.java:200)      at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)      at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)      at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)      at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)      at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)      at jrun.servlet.FilterChain.service(FilterChain.java:101)      at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)      at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)      at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)      at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)      at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)      at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)      at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)      at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)      at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

functions.cfc is the MainFunctions I mentioned before, and profile.cfm of course is the file that is requesting the GenerateRelatedContent function.

I got a hunch something is trying to use the UserSessionInfo variable somewhere incorrectly... so I am going to go through everything tonight and fully scope that variable throughout the cfc to make sure that is'nt the problem.

Translate
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 ,
Apr 05, 2011 Apr 05, 2011

I went through and looked at the hotfix notes for CF9 to see if anything might fix it, and there remotely seems like there might be a fix already for this

http://kb2.adobe.com/cps/862/cpsid_86263.html

83671If named arguments with implicit structs and arrays use local variables, it results in ‘variable is undefined’ error.1
83689cfdump does not display the changes to the functions for a CFC object.1

I suspect 83689 might fix the problem... but I won't know for sure until it runs for a few hours.

Translate
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
LEGEND ,
Apr 06, 2011 Apr 06, 2011

Do me a favour, and tidy up that code a bit.  VAR-scope all your local variables.  Putting var. in front of them doesn't achieve this: you need to either put them in the local scope (you're on CF9, yeah?), or use the VAR keyword.  Unless yuo explicitly want a variable to go into the CFC instance's variables scope (which is completely legit, but doesn't seem to be the case in your code), then you should VAR-scope all variables.  All the time.

That includes all the ones in getuserInformation(), and any other methods in that CFC.  And in any method/function you write.  Ever.

So getUserInformation() is in /cms/functions.cfc?  That's really the code we need to see, not the calling code.  It'll not be the calling code causing the problem, it'll be the code being called.

You can easily enough remove any notion of "trade secrets" from the CFC by obfuscating variable names and method names (which is a simple search and replace).  But fair enough to not want to post so much code here.  12000 lines is way to big for one component I think.  You should consider decomposing it into smaller components.

If you can obfuscate things to your liking, email it to me @ adam DOT cameron DOT signup PLUS adobeforums AT gmail DOT com.

--

Adam

Translate
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 ,
Apr 06, 2011 Apr 06, 2011
LATEST

I sent you an email reply. I consealed a little bit of the start of the GetUserInformation function, but I seem to be having even worse issues with cfset var variablename

Translate
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 ,
Apr 05, 2011 Apr 05, 2011

and there goes that theory... With the new update in place it still has the issue. I still have more code to clean so hopefully that will fix it when I upload the new functions file, but I'm still baffled on this.

Translate
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