Skip navigation
Currently Being Moderated

UrlLoader throwing security sandbox exception in Firefox

Jun 3, 2012 4:05 AM

Our app used to work fine on all browsers (IE, chrome, firefox is what we deliver it into) but for more than a month now it has stopped working on firefox selectively. By selectively I mean that it works on firefox on some machines like - if a user accesses it from home network it works fine, and for some users it works on office networks as well so we cant really generalize. I debugged the code within office network and these are the first 3 lines of trace that I get on console.

 

[SWF] C:\VMC_Development_Release\New_UI\bin-debug\xyz.swf - 4,166,632 bytes after decompression

*** Security Sandbox Violation ***

SecurityDomain 'null' tried to access incompatible context 'file:///C:/VMC_Development_Release/New_UI/bin-debug/xyz.swf'

 

Above error comes when first xml is loaded by the app. The error is thrown on the line in bold.

 

public function loadAppXml():void

            {

                var urlLoad:URLLoader=new URLLoader();

                urlLoad.load(new URLRequest("xmls/emailName.xml"));

                urlLoad.addEventListener(Event.COMPLETE, onXmlLoaded);

            }

 

public function onXmlLoaded(e:Event):void

            {

                var xm:XML=XML(e.currentTarget.data);

            }

 

We have not been using crossdomain.xml at all. and i dont think that is the cause of the problem as our app works on mozilla on many machines anyways.

 

Can anybody suggest a solution?

Any help is highly appreciated.

 
Replies
  • Currently Being Moderated
    Jun 4, 2012 10:14 AM   in reply to Shubhra Bhushan

    You are loading SWFs off the local file system and the SWF is loading a local file.  Depending on how the SWF was built, it might require trust files in order to work.  See the Flash Player Security Whitepapers.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 4, 2012 11:19 PM   in reply to Shubhra Bhushan

    Try using a network monitor to see if the SWF is trying to access the network.  You have to set use-network properly or use trust files depending on what you want to do.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 19, 2012 9:55 AM   in reply to Shubhra Bhushan

    I assume your goal is to deploy this on a production server.  If so, then I would not run it from file:// and instead do all of your testing via a server.  You can set up a localhost server on your development machine if needed.  Then, make sure that flash.system.Security.sandboxType is “remote” by adding some small label to the app.  Once you are set up in such an environment, see if you still have the problem and post the exact text of the errors including stack traces.  The one in your original post probably came from some other sandbox type.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 20, 2012 9:38 AM   in reply to Shubhra Bhushan

    It can only be set by how you run your app.  You must run it from http:// or https:// and not fiile:// or some local path.  That’s why I said you should set up a server for testing.  LocalTrusted has different security rules and some things won’t work or won’t work when you finally deploy to “remote”.  So get set up properly in development and you will have fewer surprises in production.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 20, 2012 10:37 PM   in reply to Shubhra Bhushan

    Notice that you have not gotten a security error in this configuration.  See this article: http://www.judahfrangipane.com/blog/2007/02/15/error-2032-stream-error /

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 21, 2012 12:41 AM   in reply to Shubhra Bhushan

    It would be odd to use AMF to load XML files.  Why aren’t you using URLLoader or HTTPService?

    You are not getting a security error so crossdomain.xml probably isn’t a factor.

     

    As you can tell from the article and by searching the internet, this problem happens to a lot of people.  Judah’s article has helped a lot of folks, but some seem to have found other solutions.  I am not an expert in resolving #2032 errors.  You will have to research it on your own.  The first thing I would do, however, is use a network monitor.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 21, 2012 9:44 AM   in reply to Shubhra Bhushan

    It was unreadable for me.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 21, 2012 11:16 PM   in reply to Shubhra Bhushan

    Excellent.  Please add your story to the link I provided so others can use it for reference.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points