4 Replies Latest reply on Jul 30, 2008 12:03 PM by sws

    Server Side Redirect Problem

      This is a little strange. I've got a server side redirect that works fine on my CF8 development server but throws an IllegalStateException when run at my host (hostmysite.com).

      EDIT: actually, the ColdFusion exception message is:
      access denied (java.io.FilePermission C:\Coldfusion8\wwwroot\WEB-INF\cfclasses\cftarget2ecfm168784208.class write)

      The error persists until I browse to the target page manually. Then the redirect works fine until I come back and try it again the next day. Same problem, java.io.FilePermission error until I browse to the target page.

      It's almost like the server-side redirect is looking for a compiled class file for the target page. This class file must not exist in cache until I browse to the page manually. These compiled pages must then time-out at some point.

      Anyone else experience this or have some insight on what is going on?

      *** edited for clarity and include ColdFusion exception message

        • 1. Re: Server Side Redirect Problem
          sws Level 1
          Update... The error displayed above was what was sent to the screen. I actually caught the exception using onError() in my Application.cfc and emailed it to me.

          This is what I get:
          java.security.AccessControlException: access denied (java.io.FilePermission C:\Coldfusion8\wwwroot\WEB-INF\cfclasses\cfindex2ecfm789153611.class read)

          What does it mean?

          • 2. Re: Server Side Redirect Problem
            BKBK Adobe Community Professional & MVP
            could we see the code?
            • 3. Server Side Redirect Problem
              sws Level 1
              To recreate the error I've stripped my code down to the bare min and threw in a test folder with a new application name. There are 5 files.


              The first time I run /test/redirect.cfm it works fine. If I update /test/pub/target.cfm, and browse to /test/redirect.cfm, I don't see the changes (CF didn't recompile /test/pub/target.cfm?).
              If I update /test/redirect.cfm (maybe throw in a comment) and browse to it, it will throw the fileAccess error. If I browse to the /test/pub/target.cfm file, the page displays properly and now I can browse to /test/redirect.cfm again without error.

              Now if I update /test/pub/target.cfm and browse to /text/redirect.cfm, I also get the error. Before I just wasn't getting the updated target page, but now it errors.

              So that's how I recreated the error. Here's the real problem... After I get the redirect working (by running the target page manually) it will end up breaking again after an unknown amount of time (I usually find out it's broken the next morning).

              P.S. - I've noticed the first time I get the error it ends in "write":
              access denied (java.io.FilePermission C:\Coldfusion8\wwwroot\WEB-INF\cfclasses\cftarget2ecfm168784208.class write)

              Subsequent errors end in "read":
              access denied (java.io.FilePermission C:\Coldfusion8\wwwroot\WEB-INF\cfclasses\cftarget2ecfm168784208.class read)

              ***edit: typo

              • 4. Re: Server Side Redirect Problem
                sws Level 1
                The hosting company was able to resolve my issue. Turned out to be a permissions problem. Here's their response...

                It was a permissions problem with the SandBox Security in ColdFusion. Basically ColdFusion needed to be able to write to certain directories and files, but didn't have access. Once I gave it access everything appeared to work correctly. The permissions were a little bit outside of the standard permissions, which is why it was not working initially.

                From a previous message they mentioned the ColdFusion template cache folder:

                I have added read, write, and delete access for C:\Coldfusion8\wwwroot\WEB-INF\cfclasses\ which should get rid of the errors you were seeing.