Problem with calling onApplicationStart() method
Hi all,
I have a problem with calling application.cfc's methods from coldfusion template. The problem is like when i am calling "onapplicationstart" method inside a cfml template i getting the error shown below
The onApplicationStart method was not found.
Either there are no methods with the specified method name and argument types or the onApplicationStart method is overloaded with argument types that ColdFusion cannot decipher reliably. ColdFusion found 0 methods that match the provided arguments. If this is a Java object and you verified that the method exists, use the javacast function to reduce ambiguity.
My code is like below.
Application.cfc
<cfcomponent hint="control application" output="false">
<cfscript>
this.name="startest";
this.applicationtimeout = createtimespan(0,2,0,0);
this.sessionmanagement = True;
this.sessionTimeout = createtimespan(0,0,5,0);
</cfscript>
<cffunction name="onApplicationStart" returnType="boolean">
<cfset application.myvar = "saurav">
<cfset application.newvar ="saurav2">
<cfreturn true>
</cffunction>
</cfcomponent>
testpage.cfm
<cfset variables.onApplicationStart()>
I have tried to call the above method in different way also like
1--- <cfset onApplicationStart()>
i got error like this
Variable ONAPPLICATIONSTART is undefined.
2---<cfset Application.onApplicationStart()>
Either there are no methods with the specified method name and argument types or the onApplicationStart method is overloaded with argument types that ColdFusion cannot decipher reliably. ColdFusion found 0 methods that match the provided arguments. If this is a Java object and you verified that the method exists, use the javacast function to reduce ambiguityThe onApplicationStart method was not found.
Please help me out.
Thanks
Saurav