为什么我不能在生产服务器上的ColdFusion CFC中调用函数? [英] why I can't call functions in a Coldfusion CFC on live server when it works on production?

查看:100
本文介绍了为什么我不能在生产服务器上的ColdFusion CFC中调用函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我失去了。



我通过Ajax发布到Coldfusion8 cfc,并且在我的本地机器上正常工作,在活动服务器上我不能调用此CFC中的任何函数或扩展CFC。



我想这样做:

  LOCAL.response = THIS.commit()/> 

如果转储:

 < cfdump output =e:\path\to\dump.txtlabel =catchvar =commit> 
< cfdump output =e:\path\to\dump.txtlabel =catchvar =#THIS#>
< cfset dickhead = THIS.Commit()>
< cfdump output =e:\path\to\dump.txtlabel =catchvar =out>

我得到:

 提交
************************************* ***************************

catch - component services.form_service_user
extends controllers.form_switch

方法:
DEFAULTS
[function]
参数:无
返回类型:struct
角色:
访问:public
输出:false
DisplayName:
描述:
PROCESS
[function]
参数:无
ReturnType:struct
角色:
访问:remote
输出:true
DisplayName:
描述:
COMMIT
[function]
参数:none
返回类型: struct
角色:
访问:public
输出:false
描述:
...






所以方法/函数都存在。但我不能出去。还有我清除了提交函数,除了一个单独的返回值和转储。

QUESTION

如果我在PROCESS中,为什么我不能调用COMMIT在实时服务器上,当它工作正常生产?这是某种缓存或任何设置?此外,我没有访问CFadmin,所以我或多或少猜到盲目?



感谢任何信息!



EDIT

提交调用位于try / catch中:

 < cftry> 
< cfdump output =e:\dump.txtlabel =catchvar =a>
< cfdump output =e:\dump.txtlabel =catchvar =#THIS#>
< cfset LOCAL.Response = THIS.Commit()>
< cfdump output =e:\dump.txtlabel =catchvar =b>

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

我收到AJAX返回的commit error

解决方案

检查您的方法的访问属性。



如果您在同一组件中的另一个方法中调用组件中的方法(或继承父组件),则访问必须是private,public或package。它不能远程。



确保ColdFusion映射对于活动服务器是正确的。



确保您已将所有应用程序文件部署到活动服务器的正确位置。


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

解决方案

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.

这篇关于为什么我不能在生产服务器上的ColdFusion CFC中调用函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆