在coldfusion 10中,我得到了以下错误:“从Application.cfc调用事件处理程序方法时发生了异常,方法名为: onRequestStart "。
Rootcause:Detail:“如果将组件名称指定为返回类型,则可能找不到组件的定义文件或无法访问。
RootCause:Message:“从init_pagedatetype_ver04函数返回的值不是gg2_pagedatetype_cfc_ver04类型的。
*知道我做错了什么吗?这是相关文件和相关代码*
文件#1:"\application.cfc"
<cfset THIS.mappings["/inc_CFC"]= getDirectoryFromPath(getCurrentTemplatePath())
& "/inc_CFC" >
<cffunction name="onRequestStart">
<!--- INIT page structure --->
<cfset REQUEST.paths.msg= (getDirectoryFromPath(getCurrentTemplatePath())
& "inc_CFC") >
<cfset REQUEST.gg2_pageDataStruct= 0 >
<cfinvoke
returnvariable="REQUEST.gg2_pageDataStruct"
component="inc_CFC.gg2_pagedatatype_cfc_ver04"
method="init_pagedatetype_ver04"></cfinvoke>
. . .
</cffunction> "\inc_CFC\gg2_pagedatatype_cfc_ver04.cfc"文件#1:
<cfcomponent output="false"
displayname="gg2_pagedatetype_cfc_ver04"
hint="Component/Class/Module that manages all business Data " >
. . .
<cffunction name="init_pagedatetype_ver04"
returntype="gg2_pagedatetype_cfc_ver04" output="false" >
<cfset var LOCAL=StructNew()>
<!--- Do nothing but create blank object / component for now. Later on
user will call other functions to init parts of structure/component --->
<cfreturn THIS>
</cffunction>
. . .
</cfcomponent>发布于 2012-06-28 12:46:01
你只是有一些拼写错误--看看这些:
gg2_pagedatatype_cfc_ver04
gg2_pagedatetype_cfc_ver04一个说data,另一个说date。确保您的所有名称和类型正确匹配,您的错误将消失。
https://stackoverflow.com/questions/11237374
复制相似问题