Question
CFC invokes kill the page
Hi all,
I've used CFC's before just fine but for some reason the same code that works locally is dying on the live server. For example, in my application.cfc I have this...
<cffunction name="onApplicationStart" returnType="boolean" output="false">
<cfset application.system = createObject("component", "system") />
<cfreturn true />
</cffunction>
Then in my template I have something like...
<cftry>
<cfinvoke component="system" method="getItems" returnvariable="items">
<cfinvokeargument name="item_id" value="#url.item_id#" />
</cfinvoke>
<cfcatch type="any"><p class="error"><strong>Problem Invoking CFC Method</strong></p></cfcatch>
</cftry>
Everytime I execute the page I get the message from the cftry block. If I remove the cftry tags, everything AFTER the invoke is blank and it's killed everything - but no native Coldfusion error occurs s I'm a bit lost as to what's causing it.
One thing to note here is that this is a seperate application.cfc to another above it and everything I'm working on is in it's own folder so it shouldn't be a problem. The folder is also mapped as a sub-domain...would that make any difference?
Another thing I noticed is that if I navigate directly to the cfc through the browser, it just looks blank instead of presenting me with the coldfusion administrator like it normal should. e.g. if i type the path... http://mysubdomain.mysitewhatever.com/cfc/system.cfc (i changed the sub domain and site name for security but the structure is the same)
Any help with this would be much appreciated.
Regards,
Michael.
here's my web site structure:
- main website (folder)
- application.cfc
- index.cfm
- subdomain (folder)
- - application.cfc
- - index.cfm
- - cfc (folder)
- - - system.cfc
I've used CFC's before just fine but for some reason the same code that works locally is dying on the live server. For example, in my application.cfc I have this...
<cffunction name="onApplicationStart" returnType="boolean" output="false">
<cfset application.system = createObject("component", "system") />
<cfreturn true />
</cffunction>
Then in my template I have something like...
<cftry>
<cfinvoke component="system" method="getItems" returnvariable="items">
<cfinvokeargument name="item_id" value="#url.item_id#" />
</cfinvoke>
<cfcatch type="any"><p class="error"><strong>Problem Invoking CFC Method</strong></p></cfcatch>
</cftry>
Everytime I execute the page I get the message from the cftry block. If I remove the cftry tags, everything AFTER the invoke is blank and it's killed everything - but no native Coldfusion error occurs s I'm a bit lost as to what's causing it.
One thing to note here is that this is a seperate application.cfc to another above it and everything I'm working on is in it's own folder so it shouldn't be a problem. The folder is also mapped as a sub-domain...would that make any difference?
Another thing I noticed is that if I navigate directly to the cfc through the browser, it just looks blank instead of presenting me with the coldfusion administrator like it normal should. e.g. if i type the path... http://mysubdomain.mysitewhatever.com/cfc/system.cfc (i changed the sub domain and site name for security but the structure is the same)
Any help with this would be much appreciated.
Regards,
Michael.
here's my web site structure:
- main website (folder)
- application.cfc
- index.cfm
- subdomain (folder)
- - application.cfc
- - index.cfm
- - cfc (folder)
- - - system.cfc