why I can't call functions in a Coldfusion CFC on live server when it works on production?

拥有回忆 提交于 2019-12-11 01:57:00

问题


I'm at a loss.

I'm posting to a Coldfusion8 cfc via Ajax and while it works fine on my local machine, on the live server I cannot call any function in this CFC or it's extended CFC.

I want to do this:

<cfset LOCAL.response = THIS.commit() />

If I dump:

<cfdump output="e:\path\to\dump.txt" label="catch" var="committing"> 
<cfdump output="e:\path\to\dump.txt" label="catch" var="#THIS#"> 
<cfset dickhead = THIS.Commit() >
<cfdump output="e:\path\to\dump.txt" label="catch" var="out"> 

I'm getting:

committing 
****************************************************************

catch - component services.form_service_user 
    extends controllers.form_switch

Methods: 
    DEFAULTS
        [function]
            Arguments: none 
            ReturnType: struct 
            Roles:  
            Access: public 
            Output: false 
            DisplayName:  
            Description:  
PROCESS
        [function]
            Arguments: none 
            ReturnType: struct 
            Roles:  
            Access: remote 
            Output: true 
            DisplayName:  
            Description:   
COMMIT
        [function]
            Arguments: none 
            ReturnType: struct 
            Roles:  
            Access: public 
            Output: false 
    Description:  
             ...

So the methods/functions are there. But I'm not getting to out. Also I have cleared out the commit function except for a lone return value and a dump. I'm neither getting the dump nor the return value.

QUESTION:
If I'm inside PROCESS, why can I not call COMMIT on the live server when it works fine on production? Is this some kind of caching or whatever setting? Also, I don't have access to the CFadmin, so I'm more or less guessing blind?

Thanks for any infos!

EDIT:
The commit call is inside a try/catch:

<cftry>     
    <cfdump output="e:\dump.txt" label="catch" var="a"> 
    <cfdump output="e:\dump.txt" label="catch" var="#THIS#"> 
    <cfset LOCAL.Response = THIS.Commit() >
    <cfdump output="e:\dump.txt" label="catch" var="b"> 

    <!--- COMMIT ERRORS --->
    <cfcatch>
            <cfdump output="e:\dump.txt" label="catch" var="ERROR">
            <cfset LOCAL.Response.Success = false />
            <cfset LOCAL.Response.Errors = [["server_error","commit error"]] />     
    </cfcatch>
</cftry>   

I'm getting the "commit error" returned by AJAX


回答1:


Check the access attribute on your methods.

If you are calling a method in a component (or inherited from a parent component) from another method in the same component, then access must be private, public or package. It cannot be remote.

Make sure your ColdFusion mappings are correct for the live server.

Make sure you have deployed all of the application files to the live server in the right location.



来源:https://stackoverflow.com/questions/11367653/why-i-cant-call-functions-in-a-coldfusion-cfc-on-live-server-when-it-works-on-p

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!