Skip navigation
Welcome, Balaji
Currently Being Moderated

Error #2048: Security sandbox violation

Jan 25, 2012 1:40 AM

Hi,

 

Need help in resolving the security sandbox issue arising in flash player 10.

 

I'm trying to Invoke a HTTP service available in 'Tomcat A' through my Flex application deployed in 'Tomcat B'. during this scenario i'm getting the security sandbox violation message like below,

 

text = "Error #2048: Security sandbox violation: https://01hw146543:8443/Test/Test.swf cannot load data from https://01hw348701:8443/Test/Test.xml."

 

 

Here i'm invoking a http service available in https://01hw348701:8443/Test/Test.xml from my Test.swf, where Test.xml is a simple XML file located in Sever

 

Follwoing is the code I've written in Test.mxml

 

 

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark"
      xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" initialize="onInit()">
<fx:Script>
  <![CDATA[
   import mx.controls.Alert;
   import mx.utils.ObjectUtil;

   private function send():void {
    getData.send();
   }
  
   private function onInit():void {
    Security.loadPolicyFile('https://01hw348701:8443/crossdomain.xml');
    Security.allowDomain('*');
   }
  
  ]]>
</fx:Script>
<fx:Declarations>
  <!-- Place non-visual elements (e.g., services, value objects) here -->
  <s:HTTPService id="getData" url="https://01hw348701:8443/Test/Test.xml" resultFormat="e4x"
        fault="{Alert.show(ObjectUtil.toString(event.fault))}"
        result="{txtArea.text = event.result as XML}"
        />
</fx:Declarations>


<mx:VBox width="100%" height="100%">
  <mx:Button id="sendbtn" label="Send Request" click="send()"/>
  <mx:TextArea id="txtArea" width="75%" height="50%"/>
     
</mx:VBox>
</s:Application>

 

 

Request to help in solving this issue.

 

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