Application.cfm Woes...

Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. 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...
    4. 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...
    5. 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...
  3. #2

    Default 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

  4. #3

    Default 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

  5. #4

    Default 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

  6. #5

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139