6 Replies Latest reply on Mar 2, 2017 1:30 AM by markLee

    Cross Domain Issue


      I developed my Flex and Java Web applications in MyEclipse 7.1. Both applications were deployed in Tomcate 6. The URL for Flex is

      http://localhost:8080/DLI/DLI.html. Within Flex, a call is made to http://localhost:8080/ImageX/ImageServlet via Httpservice. It works fine

      using this Flex url to request for service from the server.  However, when I use to request for service

      from the server, I got this message:


      *** Security Sandbox Violation ***

      Error: Request for resource at http://localhost:8080/ImageX/ImageServlet?licNo=1003030 by requestor from is denied due to lack of policy file permissions.


      Attached is my crossdomain.xml:

      <?xml version="1.0"?>

      <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">


      <allow-access-from domain="localhost" to-ports="8080"/>

      <allow-access-from domain="" to-ports="8080"/>

      <allow-access-from domain="" to-ports="8080/>



      I placed it in http://localhost:8080/ImageX


      This is how I load my crossdomain file in my Flex (ref. http://groups.google.com/group/flex_india/browse_thread/thread/6e592c24d235e3eb)




















      <?xml version="1.0" encoding="utf-8"?>


      xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" initialize="initDomain()">



      <mx:ApplicationControlBar width="779" height="119" fillAlphas="[1.0, 1.0]">



      <mx:Image width="644" height="110" source="assets\hpublic-e.jpg" scaleContent="true" autoLoad="true"/>














      private function initDomain():void




      var ip:String = "localhost"













      What is it that I am still missing?





        • 1. Re: Cross Domain Issue
          Flex harUI Adobe Employee

          Maybe make sure the crossdomain.xml has loaded before attempting HTTP requests


          Alex Harui

          Flex SDK Developer

          Adobe Systems Inc.

          Blog: http://blogs.adobe.com/aharui

          1 person found this helpful
          • 2. Re: Cross Domain Issue
            live2_Learn Level 1

            Hi Alex,


            With the initDomain() at

            <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" initialize=initDomain()>


            Then I invoke the servlet:


                <mx:HTTPService id="imageService"


            I put Alert() in initDomain() and according to the Alert() display, the crossdomain.xml was loaded.

            But then my ServiceCapture software which tracks the internet traffic gave the following message:


            Warning: Ignoring <site-control> tag in policy file from  This tag is only allowed in master policy files.
            Warning: Domain does not specify a meta-policy.  Applying default meta-policy 'master-only'.  This configuration is deprecated.  See http://www.adobe.com/go/strict_policy_files to fix this problem.
            Error: Ignoring policy file at due to meta-policy 'master-only'.
            *** Security Sandbox Violation ***
            Error: Request for resource at by requestor from http://localhost/DLI/DLI.swf is denied due to lack of policy file permissions.


            My updated crossdomain.xml:

            <?xml version="1.0"?>
                <site-control permitted-cross-domain-policies="master-only" />
                <allow-access-from domain="localhost"/>
                  <allow-access-from domain=""/>
                <allow-access-from domain=""/>


            What is wrong with my crossdomain.xml?



            • 3. Re: Cross Domain Issue
              Flex harUI Adobe Employee

              I'm definitely not the expert in crossdomain.xml files.  Make sure you've read through the documentation on the adobe sites.  Normally, the crossdomain.xml file goes at the root and not in a subdirectory like ImageX.  You might want to try that configuration


              Alex Harui

              Flex SDK Developer

              Adobe Systems Inc.

              Blog: http://blogs.adobe.com/aharui

              • 4. Re: Cross Domain Issue



                I have a problem that is breaking my head over a week!

                I have a Flash game that works under Python.

                The game works fine in localhost, but doesn't work if

                someone try to play it from another computer. You can access mysql,

                login into the server, but can't play.

                When play it  in localhost the firestarter get first a 127.0.01 entry in 80 port, unknow service.

                Then when the game starts the entry change to 2001, unknow service.

                When other computer try to play, get a entry in 80 port, and stops there.

                Below some file parts.



                This is the config.py

                mysql_host = 'localhost'

                mysql_user = 'root'

                mysql_pass = 'pass'

                root_host = 'localhost'


                policy_line = '<?xml version="1.0"?><!DOCTYPE cross-domain-policy SYSTEM "/xml/dtds/cross-domain-policy.dtd"><cross-domain-policy>

                <site-control permitted-cross-domain-policies="all"/><allow-access-from domain="*" to-ports="843,2001,3001,4001,5001,6001,7001,8001,9001,9002,9092" />




                The init.py

                from policy_server import PolicyFactory

                from game_server import gameFactory

                from twisted.internet import reactor


                def main():

                    print 'Server Started...'

                    reactor.listenTCP(843, PolicyFactory())

                    GameServer = GameFactory('localhost', 'pt_br')

                    reactor.listenTCP(1024, gameServer)

                    reactor.listenTCP(2001, gameServer)

                    reactor.listenTCP(3001, gameServer)

                    reactor.listenTCP(4001, gameServer)

                    reactor.listenTCP(6001, gameServer)

                    reactor.listenTCP(7001, gameServer)

                    reactor.listenTCP(8001, gameServer)

                    reactor.listenTCP(9001, gameServer)

                    reactor.listenTCP(9002, gameServer)

                    reactor.listenTCP(9092, gameServer)




                if (__name__ == '__main__'):




                1. crossdomain.xml


                <cross-domain-policy><site-control permitted-cross-domain-policies="master-only"/>

                <allow-access-from domain="localhost" to-ports="843,1024,2001,3001,4001,5001,6001,7001,8001,9001,9002,9092"/>

                <allow-access-from domain="" to-ports="843,1024,2001,3001,4001,5001,6001,7001,8001,9001,9002,9092"/>




                • 5. Re: Cross Domain Issue

                  Hello you managed to make the system works if you got in touch

                  • 6. Re: Cross Domain Issue

                    hi you can google CROS ,you can get Allow-Control-Allow-Origin:  , modify config file,  CROS will be ok.