?
Solved

publish my flex application out of development server

Posted on 2009-12-19
12
Medium Priority
?
1,199 Views
Last Modified: 2013-12-24
when i publish my flex application in an external server i get that error if my flash builder beta 2 is cloused in my system , i did configer an endpoint to the dataservice to point to the external server and if i run my flash builder and any body borwose the site it open and thay can retreve the data from my application but if i close my flash builder we have this error all of us :)
Send failed
Channel.Security.Error error Error #2048: Security sandbox violation:

http://www.dcecrak.com/Maine.swf cannot load data from

http://localhost:37813/flex2gateway/?hostport=www.dcecrak.com&https=N&id=-1. url:

'http://www.dcecrak.com/flex2gateway/'

i created a crossdomain.xml file and put it in the web root , if i try to open the link http://www.dcecrak.com/flex2gateway  it open with blank page this means that every thing is oky , my service-config file looks like that :

<?xml version="1.0" encoding="UTF-8"?>
<services-config>

    <services>
        <service-include file-path="remoting-config.xml" />
        <service-include file-path="proxy-config.xml" />
        <service-include file-path="messaging-config.xml" />
    </services>

    <security>
        <login-command class="flex.messaging.security.JRunLoginCommand" server="JRun"/>
        <!-- Uncomment the correct app server
        <login-command class="flex.messaging.security.TomcatLoginCommand" server="Tomcat"/>
        <login-command class="flex.messaging.security.WeblogicLoginCommand" server="Weblogic"/>
        <login-command class="flex.messaging.security.WebSphereLoginCommand" server="WebSphere"/>
        -->
        <!--
        <security-constraint id="basic-read-access">
            <auth-method>Basic</auth-method>
            <roles>
                <role>guests</role>
                <role>accountants</role>
                <role>employees</role>
                <role>managers</role>
            </roles>
        </security-constraint>
        -->
    </security>

    <channels>

        <!--  CF Based Endpoints -->

<channel-definition id="dcecrak" class="mx.messaging.channels.AMFChannel">
            <endpoint uri="http://www.dcecrak.com/flex2gateway/" class="coldfusion.flash.messaging.CFAMFEndPoint"/>
            <properties>
                  <add-no-cache-headers>false</add-no-cache-headers>
                        <polling-interval-seconds>8</polling-interval-seconds>
                        <serialization>
                              <enable-small-messages>false</enable-small-messages>
                        </serialization>
                        <coldfusion>
                            <!-- define the resolution rules and access level of the cfc being invoked -->
                              <access>
                                    <!-- Use the ColdFusion mappings to find CFCs-->
                                    <use-mappings>true</use-mappings>
                                    <!-- allow "public and remote" or just "remote" methods to be invoked -->
                                    <method-access-level>remote</method-access-level>
                              </access>
                              
                              <!-- Whether the Value Object CFC has getters and setters. Set the value of use-accessors to true if there are getters and setters in the Value Object CFC. -->
                              <use-accessors>true</use-accessors>
                              <!--Set the value of use-structs to true if you don't require any translation of ActionScript to CFCs. The assembler can still return structures to Flex, even if the value is false. The default value is false.-->
                              <use-structs>false</use-structs>

                    <property-case>
                        <!-- cfc property names -->
                        <force-cfc-lowercase>false</force-cfc-lowercase>
                        <!-- Query column names -->
                        <force-query-lowercase>false</force-query-lowercase>
                        <!-- struct keys -->
                        <force-struct-lowercase>false</force-struct-lowercase>
                    </property-case>
                        </coldfusion>
            </properties>
        </channel-definition>
            
        <channel-definition id="cf-polling-amf" class="mx.messaging.channels.AMFChannel">
            <endpoint uri="http://{server.name}:{server.port}{context.root}/flex2gateway/cfamfpolling" class="coldfusion.flash.messaging.CFAMFEndPoint"/>
            <properties>
                <polling-enabled>true</polling-enabled>
                <polling-interval-seconds>8</polling-interval-seconds>
                        <serialization>
                              <enable-small-messages>false</enable-small-messages>
                        </serialization>
                        <coldfusion>
                            <!-- define the resolution rules and access level of the cfc being invoked -->
                              <access>
                                    <!-- Use the ColdFusion mappings to find CFCs-->
                                    <use-mappings>true</use-mappings>
                                    <!-- allow "public and remote" or just "remote" methods to be invoked -->
                                    <method-access-level>remote</method-access-level>
                              </access>
                              
                              <!-- Whether the Value Object CFC has getters and setters. Set the value of use-accessors to true if there are getters and setters in the Value Object CFC. -->
                              <use-accessors>true</use-accessors>
                              <!--Set the value of use-structs to true if you don't require any translation of ActionScript to CFCs. The assembler can still return structures to Flex, even if the value is false. The default value is false.-->
                              <use-structs>false</use-structs>

                    <property-case>
                        <!-- cfc property names -->
                        <force-cfc-lowercase>false</force-cfc-lowercase>
                        <!-- Query column names -->
                        <force-query-lowercase>false</force-query-lowercase>
                        <!-- struct keys -->
                        <force-struct-lowercase>false</force-struct-lowercase>
                    </property-case>
                        </coldfusion>
            </properties>
        </channel-definition>

        <channel-definition id="my-cfamf-secure" class="mx.messaging.channels.SecureAMFChannel">
            <endpoint uri="https://{server.name}:{server.port}{context.root}/flex2gateway/cfamfsecure" class="coldfusion.flash.messaging.SecureCFAMFEndPoint"/>
            <properties>
                <polling-enabled>false</polling-enabled>
                        <add-no-cache-headers>false</add-no-cache-headers>
                        <serialization>
                              <enable-small-messages>false</enable-small-messages>
                        </serialization>
                        <coldfusion>
                            <!-- define the resolution rules and access level of the cfc being invoked -->
                              <access>
                                    <!-- Use the ColdFusion mappings to find CFCs-->
                                    <use-mappings>true</use-mappings>
                                    <!-- allow "public and remote" or just "remote" methods to be invoked -->
                                    <method-access-level>remote</method-access-level>
                              </access>

                              <!-- Whether the Value Object CFC has getters and setters. Set the value of use-accessors to true if there are getters and setters in the Value Object CFC. -->
                              <use-accessors>true</use-accessors>
                              <!--Set the value of use-structs to true if you don't require any translation of ActionScript to CFCs. The assembler can still return structures to Flex, even if the value is false. The default value is false.-->
                              <use-structs>false</use-structs>
                              
                              <property-case>
                        <!-- cfc property names -->
                        <force-cfc-lowercase>false</force-cfc-lowercase>
                        <!-- Query column names -->
                        <force-query-lowercase>false</force-query-lowercase>
                        <!-- struct keys -->
                        <force-struct-lowercase>false</force-struct-lowercase>
                    </property-case>
                        </coldfusion>
            </properties>
        </channel-definition>
       
        <!--  Java Based Endpoints -->
        <channel-definition id="java-amf" class="mx.messaging.channels.AMFChannel">
            <endpoint uri="http://{server.name}:{server.port}{context.root}/flex2gateway/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
        </channel-definition>

        <channel-definition id="java-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
            <endpoint uri="https://{server.name}:{server.port}{context.root}/flex2gateway/amfsecure" class="flex.messaging.endpoints.SecureAMFEndpoint"/>
        </channel-definition>

        <channel-definition id="java-polling-amf" class="mx.messaging.channels.AMFChannel">
            <endpoint uri="http://{server.name}:{server.port}{context.root}/flex2gateway/amfpolling" class="flex.messaging.endpoints.AMFEndpoint"/>
            <properties>
                <polling-enabled>true</polling-enabled>
                <polling-interval-seconds>8</polling-interval-seconds>
            </properties>
        </channel-definition>

        <!--
        <channel-definition id="java-http" class="mx.messaging.channels.HTTPChannel">
            <endpoint uri="http://{server.name}:{server.port}{context.root}/flex2gateway/http" class="flex.messaging.endpoints.HTTPEndpoint"/>
        </channel-definition>

        <channel-definition id="java-secure-http" class="mx.messaging.channels.SecureHTTPChannel">
            <endpoint uri="https://{server.name}:{server.port}{context.root}/flex2gateway/httpsecure" class="flex.messaging.endpoints.SecureHTTPEndpoint"/>
        </channel-definition>
        -->
    </channels>

    <logging>
        <target class="flex.messaging.log.ConsoleTarget" level="Error">
            <properties>
                <prefix>[BlazeDS] </prefix>
                <includeDate>false</includeDate>
                <includeTime>false</includeTime>
                <includeLevel>false</includeLevel>
                <includeCategory>false</includeCategory>
            </properties>
            <filters>
                <pattern>Endpoint.*</pattern>
                <pattern>Service.*</pattern>
                <pattern>Configuration</pattern>
                <pattern>Message.*</pattern>
            </filters>
        </target>
    </logging>

    <system>
        <manageable>false</manageable>
        <!--
        <redeploy>
            <enabled>true</enabled>
            <watch-interval>20</watch-interval>
            <watch-file>{context.root}/WEB-INF/flex/services-config.xml</watch-file>
            <watch-file>{context.root}/WEB-INF/flex/proxy-config.xml</watch-file>
            <watch-file>{context.root}/WEB-INF/flex/remoting-config.xml</watch-file>
            <watch-file>{context.root}/WEB-INF/flex/messaging-config.xml</watch-file>
            <watch-file>{context.root}/WEB-INF/flex/data-management-config.xml</watch-file>
            <touch-file>{context.root}/WEB-INF/web.xml</touch-file>
        </redeploy>
         -->
    </system>

</services-config>


and my crossdomain.xml looks like that :

<cross-domain-policy>
<site-control permitted-cross-domain-policies="all"/>
<allow-access-from domain="localhost" to-ports="*" secure="false"/>
<allow-access-from domain="*" to-ports="*" secure="false"/>
<allow-http-request-headers-from domain="*"/>
</cross-domain-policy>


really its strange :) only the site works if my flash builder is running , please help
0
Comment
Question by:Developer2010
  • 8
  • 4
12 Comments
 

Author Comment

by:Developer2010
ID: 26089333
if i am trying to access the data from my flex application and at the time the application querying the database if i close my flash builder it gives me an error that the data channel is terminated and cant establish the Netconnecton  really i don't know that is that
0
 

Author Comment

by:Developer2010
ID: 26089336
by the way my website link is http://www.dcecrak.com/maine.html please check the error , and pleas e i need to solve this problem
0
 
LVL 14

Expert Comment

by:TanLiHao
ID: 26094287
Hmm, I looked at the error and I find it weird why you attempt to access your local files from a web server.


I looked at your other post in another question as well and your other question posted, now before I ask about any other thing I want to ask about your error. Here's your error.

Send failed
Channel.Security.Error error Error #2048: Security sandbox violation: http://www.dcecrak.com/Maine.swf cannot load data from http://localhost:37813/flex2gateway/?hostport=www.dcecrak.com&https=N&id=-1. url: 'http://www.dcecrak.com/flex2gateway/'

Why are you trying to access localhost from a webpage, this is weird because everybody who access the page have a localhost that may not have the same data as you, and it might not be configured to even function as a server.

Second thing I might want to mention is that a SWF can only access the internet's resources or the local filesystem's resources. It can't do both. Using a localhost may still be accessing the local filesystem's resources but I am not really sure about that, because I have never tried to do this as it is weird and I mentioned the reason above.

However, the Flash Player in Flex Builder/ Flash Builder/ Adobe Flash/ or most Flash Development tools have an elevated privilege where the SWF can access both internet and local filesystem resources. However, that is only allowed when you compile the SWF and test it there, it won't be actually allowed if you run from a browser or a Flash Player in your filesystem.

That said, I want to ask you if you actually meant that you SWF works when you run it from the Flash Builder. Or did you try to run the swf by double-clicking it after it compiled, that is from a standalone flash player that comes with Flash Builder and not within Flash Builder.
0
New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

 

Author Comment

by:Developer2010
ID: 26095096
ok i will delete the other question and i have flash builder and coldfusion 9 on my system and if i open my flash builder and run the application from it every thing works fine even if any body else access the application witch is uploaded in the external server (external hosting) both works fine but as  i close my flash builder me with my local belt in web server or any person access the site http://www.dcecrak.com have error
0
 
LVL 14

Expert Comment

by:TanLiHao
ID: 26095367
Try running the swf or the page if there is not within the Flash Builder. Do you still get the error?

When your Flash Builder is open, you said that anybody else can access the site and it works , but when you close it, it doesn't work? Do you mean the anyone by even people out of your network? Say your friends connected to another Internet?

I really suspect the thing you said about anyone can access the page when your Flash Builder is open, or do you mean that the server is on as well? Even so, the SWF is accessing the localhost, which is your own computer, even people on the same network as you shouldn't be able to access that unless your host entry is changed or something.

Is your application able to run as standalone or not?
0
 

Author Comment

by:Developer2010
ID: 26095640
look ,,, i have my computer with coldfusion 9 , flash builder 4 , and my application , if i run my application  from my flash builder or even if i go to the browser and type http://localhost:8500/dcecrak/maina.html witch is the url for my app in my local network  me or any one in network can run it . even if any one out side the network and type http://www.dcecrak.com witch is the external hosting fro my site contains the files witch i uploaded  can access the data with no errors.
my application is not an Air application so it cant runs stand alone . it should be hosted in coldfusion hosting server .
0
 

Author Comment

by:Developer2010
ID: 26099353
dear tanLiHao , yes i have anther Air application running very well
0
 

Author Comment

by:Developer2010
ID: 26099372
sorry the ather Air application is running very well on my system it use also coldfusion and mysql , no problems in my system if i close the flash builder or if anybody out of my network open the applicaiont it works not like the dcecrak.com web application , please help in that
thanks
0
 

Accepted Solution

by:
Developer2010 earned 0 total points
ID: 26102152
Dear TanLiHao ,

  Thanks for your attention, i have solved my problem and i think its a bug in the flash builder , the problem was that when you compile the application and you enabling Network Monitoring , the communication of the AMF channels done throw the  http://localhost:37813/flex2gateway/
and that was the problem if you close the flash builder on your system that getaway dose not exist and on the hosted server there is no such address localhost by this port also so the client application witch is catch in you system try to access your localhost and that cause a security error and the address is also not exist .

so the solution or we have to compile the project after we disable the Network Monitoring in flash builder .
0
 
LVL 14

Expert Comment

by:TanLiHao
ID: 26102171
Ah yes that was what I was trying to say all along. Though I didn't know it's a bug in the Flash Builder or something but accessing localhost differs for everyone so when they do not have a server open, it results in an error because localhost resolves to the local filesystem.
0
 

Author Comment

by:Developer2010
ID: 26102180
i will not give you the points , you have to tel me how i get that points to myself , hhhhhhhhhhhhhhhhhh
thanks a lot for your attention TanLiHao
0
 
LVL 14

Expert Comment

by:TanLiHao
ID: 26102237
Hmm, I'm not sure how you give the points to yourself because I have never asked a question before but closing the question should fix it if you are not deleting the question.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question