Results 1 to 7 of 7

Thread: GetPageContext include method causing a security exception - in hosted environment

  1. #1
    scaph01 Guest

    Unhappy GetPageContext include method causing a security exception - in hosted environment

    Maybe someone can point me in the right direction. I an a noob with Coldfusion and I am trying to call a jsp page from a cold fusion page. On my local development environment the following code works fine (taken from Adobe documentation)

    Code:
    <cfscript> 
      GetPageContext().include('testvars.jsp?name=Robi%20Sen'); 
    </cfscript>
    where testvars.jsp is in the same directory as the CFM file.

    When i upload to host, i get the following error:


    Security: The requested template has been denied access to C:\ColdFusion9\wwwroot\Mobile\testvars.jsp.

    I do know that the pages are on the D: drive and not on the C:\ drive. So the reference to the C:\ColdFusion... path has me scratching my head....

    I can directly access the JSP file and for now, I have placed it in an IFRAME as a short term hack.


    From the java documentation fior the include method i have read:

    If the relativeUrlPath begins with a "/" then the URL specified is calculated relative to the DOCROOT of the ServletContext for this JSP. If the path does not begin with a "/" then the URL specified is calculated relative to the URL of the request that was mapped to the calling JSP.

    the host does not have many Cold fusion settings to change / tweak or view...so any debugging pointers or assistance will be welcomed

    Phil
    Last edited by scaph01; December 27th, 2010 at 02:53 PM.

  2. #2
    Join Date
    May 2009
    Location
    Tulsa, OK
    Posts
    220

    Default

    Phil,

    I would suggest giving the include the full path to your .jsp file like:

    Code:
    <cfscript> 
      GetPageContext().include('d:/home/your_domain.com/wwwroot/testvars.jsp?name=Robi%20Sen'); 
    </cfscript>

  3. #3
    scaph01 Guest

    Default re: GetPageContext include method causing a security exception - in hosted environmen

    Thanks for the fast response Brian, I tried the code you recommended

    Code:
    <cfscript> 
      GetPageContext().include('d:/home/your_domain.com/wwwroot/testvars.jsp?name=Robi%20Sen'); 
    </cfscript>

    but i see the root directory is some sort of constant....as i get the following exception now...

    Code:
    Security: The requested template has been denied access to C:\ColdFusion9\wwwroot\Mobile\d:\home\slingping.com\wwwroot\Mobile\testvars.jsp.
    
         The following is the internal exception message: access denied (java.io.FilePermission C:\ColdFusion9\wwwroot\Mobile\d:\home\slingping.com\wwwroot\Mobile\testvars.jsp read)

    Thanks for your help!

    Phil
    Last edited by scaph01; December 27th, 2010 at 05:40 PM.

  4. #4
    Join Date
    May 2009
    Location
    Tulsa, OK
    Posts
    220

    Default

    Phil,

    That's weird. It find sthe correct path when it's a .cfm file, but not when a .jsp. I've had a couple of our guys research this and didn't come up with anything. You may want to ask Adobe about this in a shared environment.

  5. #5
    scaph01 Guest

    Default re: GetPageContext include method causing a security exception - in hosted environmen

    Thanks Brian, i have started some threads elsewhere on this same topic. Is there any more settings for cold fusion in Parrallels Helm control panel that i check out? I only see "enable cold fusion" and "enable sand box". From what I think the hostek server is using Java 1.4, my local environment has 1.6

    Thanks
    Phil

  6. #6
    Join Date
    May 2009
    Location
    Tulsa, OK
    Posts
    220

    Default

    That's all of the CF related options in the Helm control panel. I checked this server and it was running the default Java version that ships with CF9. Most of our servers use 1.6. I have updated this server to use 1.6 build 22.

  7. #7
    scaph01 Guest

    Unhappy re:etPageContext include method causing a security exception - in hosted environmen

    Thanks for the help,

    I have now been seeing some random JRun compilation errors with my simple JSP so there is something happening on this server ever since the jave upgrade.

    Back to my original issue...

    I have raised a question on Adobe support and have not had any pointers or help...

    http://forums.adobe.com/thread/771225

    I also asked this question on house of fusion here: http://www.houseoffusion.com/groups/...threadid:62408


    The last suggestion was to try to emulate hostek's setup, i see i am running the site in sandboxed environment (checked in the Help control panel under Coldfusion options).

    What settings are used for jrun - and are they tunable?

    Can you give me a dump of all of the coldfusion settings in place - so i can setup my envirnment to match hosteks?

    Thanks
    Phil

Tags for this Thread

Posting Permissions

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