Solved

Need help with coldfusion application.cfc

Posted on 2008-10-15
12
297 Views
Last Modified: 2013-12-24
Hi,

I have a coldfusion forum application. The application is pretty old and uses application.cfm file. But now I have changed the application.cfm file to cfc which is giving me a number of variety errors? I am basically new to coldfusion and I have no Idea why I am getting these errors.

1st error was when I was trying to create a <cfapplication tag which is
<cfapplication name="EUCOM" sessionmanagement="yes"
sessiontimeout=#CreateTimeSpan(0,0,20,0)#>

The error I am getting is 5 >= 0  

2ns one is I have a template included in application.cfc which in also has another template called queries/qry_forum.cfm. which was working fine when I was using application.cfm file. and after I changed cfm to cfc the error here is

Could not find the included template queries/qry_forum.cfm.

Can any one please help me with this.

Thanks in advance!

S
0
Comment
Question by:coolSri
  • 6
  • 5
12 Comments
 
LVL 1

Expert Comment

by:jsimonuchc
ID: 22724483
Why did you chance the application.cfm to application.cfc? Application.cfm is a required file for ColdFusion applications. You cannot remove it. Your errors are probably happening because your application is looking for the application.cfm file.
0
 

Author Comment

by:coolSri
ID: 22724591
Because we are using coldfusion7. And in coldfusion 7 we need application.cfc instead of cfm.
0
 
LVL 36

Expert Comment

by:SidFishes
ID: 22724642
not correct...

all versions of CF can use application.cfm

application.cfc can be used with 7 & 8 but is -not- necessary
0
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 36

Expert Comment

by:SidFishes
ID: 22724665
fyi ben nadel has a good tutorial on application.cfc here

http://www.bennadel.com/blog/726-ColdFusion-Application-cfc-Tutorial-And-Application-cfc-Reference.htm

as you can see it is sturctured very differently from applicition.cfm and can do a lot more however again applicition.cfm is fine to use in any version
0
 

Author Comment

by:coolSri
ID: 22724853
I know it works with cfm but what if I want to change it to CFC..?
0
 
LVL 36

Accepted Solution

by:
SidFishes earned 250 total points
ID: 22725122
impossible to say without knowing your app (although my first response is -why-?)

you might be able to just change

<cfset THIS.Name = "EUCOM" />
<cfset THIS.ApplicationTimeout = CreateTimeSpan( 0, 0, 20, 0 ) />
<cfset THIS.SessionManagement = true />
<cfset THIS.SetClientCookies = false />

and add queries/qry_forum.cfm to the onRequest function

<cffunction
name="OnRequest"
access="public"
returntype="void"
output="true"
hint="Fires after pre page processing is complete.">

<cfinclude template="queries/qry_forum.cfm" />
<cfreturn />
</cffunction>

but these are just guesses... and changing may have unforeseen consequences depending on how your app is written

0
 

Author Comment

by:coolSri
ID: 22725183
I have tried the above but it still giving the same errors. I will possible leave it as cfm itself. Thanks for all your help though.
0
 
LVL 36

Expert Comment

by:SidFishes
ID: 22725300
as far as I'm concerned this is a "you can't" http://www.experts-exchange.com/help.jsp#hi405 answer (or you shouldn't asit could have unforseen effects on an existing app) and points should be awarded accordingly





0
 

Author Comment

by:coolSri
ID: 22725383
I did not get a possible solution for it. And what ever you have suggested I have already worked on it. So I guess it is not fair enough to award points.
0
 

Author Comment

by:coolSri
ID: 22725415
And it is not a you can't answer. Because we had other applications for which we changed .cfm file to .cfc(we need to work a little bit on it). I am not able to do it since I am new to this.
0
 
LVL 36

Expert Comment

by:SidFishes
ID: 22725508
my point is this...

1) some applications could easily be changed to cfc with no impact
2) if you did change there's no way to provide a simple answer with what you have provided, especially since you "are new to this" the reason you are receiving errors is precisely due to what I said "it could have unforseen effects on an existing app"
3) there's no reason to change as I answered your post "And in coldfusion 7 we need application.cfc instead of cfm." That is incorrect and my answer -corrects- your misconception

but I'm out of here...

moderators...what ever you feel is fair

0
 

Author Comment

by:coolSri
ID: 22725598
Just because you have said cfc and cfm both work with coldfusion7 I need not award you points. I was looking for some kind of solution where I will be guided to change to cfc.  But all you could tell me is they both work for cf7 which is not what I was looking for and is no way close to my question. From the begining all you said was why do you want to change but not how to change. So I guess points should not be awarded.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
All of the resources available today make learning a new digital media easier than ever-- if you know where to begin. This is a clear, simple guide to a few of the basic digital art mediums and how to begin learning them on your own.
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question