Ask a Question related to Macromedia ColdFusion, Design and Development.
-
Ant Cunningham [VECTR BAS-D] #1
Application.cfm Woes...
I think for some reason my Application.cfm isnt being resolved before my
pages... I was trying some more complicated detection and setting stuff but
in the process of trouble shooting I reduced it to just attempting to set my
datasource. It still didnąt work.
Im running JRun4 / CFMX 6.1 on OSX, I have Apache set up as an external
server and my context root is set to /
My director y structure looks like so:
| Web root
|-- bm
|---- bm_com
|------ beta
"beta" is the site root. Within "beta" lies Application.cfm and test.cfm.
In Application.cfm I have a simple statement:
<cfapplication name="basslinebeta" clientmanagement="yes"
sessionmanagement="yes" sessiontimeout="60" applicationtimeout="120">
<cfset datasource = "dataSourceName">
</cfapplication>
In test I have:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<cfquery name="tester" datasource= "#datasource#">
SELECT *
FROM someTable
</cfquery>
</head>
<body>
<cfoutput query="tester">
#someField#
</cfoutput>
</body>
</html>
The error I get is this:
Variable DATASOURCE is undefined.
The error occurred in
/Library/WebServer/Documents/bm/bm_com/beta/TMPmn29scp7f1.cfm: line 6
4 : <title>Untitled Document</title>
5 : <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6 : <cfquery name="tester" datasource= "#datasource#">
7 : SELECT *
8 : FROM someTable
As far as I know thatąs al good syntax-wise, just to make sure I added the
exact same <cfset> code to test.cfm and it worked. So thatąs what leads me
to believe its just not finding and/or interpeting Application.cfm.
Any ideas?
--
Ant Cunningham | Graphic Designer/Art Director
Vector Based Design [ VECTR BAS-D ] | [url]www.vectrbas-d.com[/url]
[email]prodigitalson@vectrbas-d.com[/email]
Ant Cunningham [VECTR BAS-D] Guest
-
j2ee woes
Hi, I recently converted from CFMX7 standalone to j2ee for the practice. Everything installed fine but I'm having problems with CFCs. I can view the... -
WSE 2 woes
I have created the Hello World web service and implemented WSE 2 tokens to validate against a database. I am using VS 2003 and installed the... -
PHP installation woes
Hi there, Could someone please give the low down on installing and configuring php on freebsd? I am running the 4.10 release as our development... -
Binary woes!
Hi, I'm recieving a base64encoded string (png file) from a webservice. I'm trying to write the file and output the image. But I'm having... -
PDF woes
EPS files are intended to be placed on a page in a page-layout program, and thus contain no page orientation or page size information. If you are... -
Iceborer #2
Re: Application.cfm Woes...
Ant, Things will improve when <cfset> is moved outside <cfapplication> Sorry,
I'm feeling poetic this morning. The <cfapplication> tag is only used to set
application-level parameters, it shouldn't try to contain all of the functions
that you want performed in Application.cfm. Try:
<cfapplication name="basslinebeta" clientmanagement="yes"
sessionmanagement="yes" sessiontimeout="60" applicationtimeout="120">
<cfset datasource = "dataSourceName">
<!--- No "closing" </cfapplication> tag --->
Iceborer Guest
-
Ant Cunningham [VECTR BAS-D] #3
Re: Application.cfm Woes...
Ah ha! You know ive been reading livedocs as well as scouring the WACK book
and this important fact isnt mentioned ANYWHERE (unless of course I missed
it)! THANX for the help.
Ill try it tonight when I get home.
in article d04apm$5rk$1@forums.macromedia.com, Iceborer at
[email]webforumsuser@macromedia.com[/email] wrote on 3/2/05 7:15 AM:
--> Ant, Things will improve when <cfset> is moved outside <cfapplication>
> Sorry,
> I'm feeling poetic this morning. The <cfapplication> tag is only used to set
> application-level parameters, it shouldn't try to contain all of the
> functions
> that you want performed in Application.cfm. Try:
>
> <cfapplication name="basslinebeta" clientmanagement="yes"
> sessionmanagement="yes" sessiontimeout="60" applicationtimeout="120">
>
> <cfset datasource = "dataSourceName">
>
> <!--- No "closing" </cfapplication> tag --->
>
Ant Cunningham | Graphic Designer/Art Director
Vector Based Design [ VECTR BAS-D ] | [url]www.vectrbas-d.com[/url]
[email]prodigitalson@vectrbas-d.com[/email]
Ant Cunningham [VECTR BAS-D] Guest
-
Dyomides #4
Re: Application.cfm Woes...
Also make sure you set up the Datasource through the Coldfusion Administrator.
If it's not set up it will produce a similar error since it has no idea what
you are making reference to. Unless you are making a dnsless connection but
from your code that is obviously not the case. Hope that helps.
Dyomides Guest
-
Ant Cunningham [VECTR BAS-D] #5
Re: Application.cfm Woes...
Yeah I already set up the DSN everything was good there. It was just
settingthat global variable in the application file that I was having issues
with.
Nevertheless I appreciate your post. :-)
in article d04cs7$8un$1@forums.macromedia.com, Dyomides at
[email]webforumsuser@macromedia.com[/email] wrote on 3/2/05 7:51 AM:
--> Also make sure you set up the Datasource through the Coldfusion Administrator.
> If it's not set up it will produce a similar error since it has no idea what
> you are making reference to. Unless you are making a dnsless connection but
> from your code that is obviously not the case. Hope that helps.
>
Ant Cunningham | Graphic Designer/Art Director
Vector Based Design [ VECTR BAS-D ] | [url]www.vectrbas-d.com[/url]
[email]prodigitalson@vectrbas-d.com[/email]
Ant Cunningham [VECTR BAS-D] Guest



Reply With Quote

