1 Reply Latest reply on Jul 22, 2008 3:27 PM by lchalnick

    Component location problems

    lchalnick Level 1
      I'm using a component via cfajaxproxy. It instantiates with the call to cfajaxproxy but then when I used it to invoke some of its functions in my javascript, I'm getting file not found errors. Here's how things are set up:

      c:\someDirs\webroot
      c:\someDirs\currentDir

      currentDir is mapped as a virtual directory off the webroot directory using the webserver's mapping ability. So when I address templates in currentDir via HTTP, it's done like this:

      http://www.theServer/currentDir/someScript.cfm

      Both the template that I'm running and the component are in currentDir.

      If I move the component to webRoot, then the script containing cfajaxproxy fails saying "The device is not ready"

      If I leave the component in currentDir, then the script will run, but when I attempt to execute any of the functions in the component via javascript calls to the object that is instantiated with cfajaxproxy, then those calls fail with the same type error message (i.e., "Uncaught exception: The device is not ready") which I get via FireBug.

      I've tried creating a CF mapping to currentDir and then addressing the component that way (in my cfajaxproxy call) but this fails. Again, the obj instantiates but I get the device is not ready message in FireBug.

      When reviewing the error in Firebug, I can see that the script is attempting to call my component off the root dir (i.e., like this: "/myComponent") rather than "/currentDir/myComponent".

      Based on the site's security configuration, I do need to keep the current script in the directory it's currently in. Any suggestions?
        • 1. Re: Component location problems
          lchalnick Level 1
          Okay...think I may be on to something. I didn't think cfc's would work for remote access in a mapped dir...yet this may be a way of "fake out" CF this way.

          If I keep the cfc in the webroot dir and map a CF dir to the webroot dir, and then instantiate the cfc in my script (which is still in currentDir) using the mapping name, it appears to work:

          Create CF mapping in the administrator:
          myRoot = c:\someDirs\webroot

          Then in my script:
          <cfajaxproxy cfc="myMapping.myComponent" class="myClass">

          This appears to work. Whew.