Automating a flex app on a headless server

I have a flex chart drawing application that needs to be automated. When automated it will read in data from the DB, draw the charts, and save them as .png files. This works flawlessly on my localhost version of oc4j on my Mac. However it has never worked on our Solaris oc4j deployment which is a headless server. I've set flex to run as headless in the config files but no dice. How can I get this working? Here are some of the error messages I'm getting:
LINUX/UNIX browser attempting to launch /opt/sfw/bin/firefox http://flexdomain.yadayadyada
08/11/06 14:41:53
user dir: /usr/local/src/oracle/product/10.1.3.2.0/OracleAS_1/j2ee/home
08/11/06 14:41:54 ERR>The application 'firefox-bin' lost its connection to the display flexdomain. yadayadyada:1.0;
08/11/06 14:41:54 ERR>most likely the X server was shut down or you killed/destroyed
08/11/06 14:41:54 ERR>the application.
08/11/06 14:41:54 ExitValue: 1
And here's a snippet from the Java which launches the flex app in the firefox browser:
String cmd = "/opt/sfw/bin/ff.sh "+ url; // ff.sh is a script which sets DISPLAY and launches firefox with the flex url
Runtime rt = Runtime.getRuntime();
Process p = rt.exec(cmd);
I'm using 10g, by the way.
Thanks!
Edited by: Solerous on Nov 7, 2008 7:04 AM

Ok, I'm convinced that this is some sort of configuration problem. I can get the browser to launch when written as a simple java program compiled at the command line:
import java.util.*;
import java.io.*;
public class Launcher {
public static void main(String args[]) throws IOException {
String url = "http://www.ebay.com";
String[] commands = {"/bin/sh", "-c", "/opt/sfw/bin/firefox ", url, "-width", "1600", "-height", "1200", ":5"};
ProcessBuilder pb = new ProcessBuilder(commands);
Map<String, String> env = pb.environment();
env.put( "DISPLAY", ":5" );
Iterator it = env.entrySet().iterator();
while (it.hasNext()) {
Map.Entry pairs = (Map.Entry)it.next();
System.out.println("\t>> environ: "+pairs.getKey() + " = " + pairs.getValue());
Process process = pb.start();
The output is just to show the environment variables and it looks like this:
     >> environ: XFILESEARCHPATH = /usr/dt/app-defaults/%L/Dt
>> environ: LANG = C
>> environ: DISPLAY = :5
>> environ: ORACLE_BASE = /oracle
>> environ: ORACLE_TERM = vt100
>> environ: PWD = /usr/local/u00/de8
>> environ: _ = /usr/bin/java
>> environ: MAGICK_HOME = /usr/ImageMagicK/ImageMagick-6.4.4
>> environ: ORACLE_SID = cots
>> environ: USER = de8
>> environ: NLSPATH = /usr/dt/lib/nls/msg/%L/%N.cat
>> environ: EDITOR = /bin/vi
>> environ: MOZILLA_SOLARIS_PATCHCHECKER = disable_patchchecker
>> environ: HOME = /u00/de8
>> environ: SSH_CONNECTION = 128.219.196.118 64994 160.91.230.33 22
>> environ: LD_LIBRARY_PATH = /usr/jdk/instances/jdk1.5.0/jre/lib/sparc/server:/usr/jdk/instances/jdk1.5.0/jre/lib/sparc:/usr/jdk/instances/jdk1.5.0/jre/../lib/sparc:/opt/SUNWspro/lib:/usr/openwin/lib:/usr/dt/lib:/usr/ImageMagicK/ImageMagick-6.4.4/lib::/oracle/product/9.2.0/lib
>> environ: LOGNAME = de8
>> environ: SHELL = /bin/ksh
>> environ: ORACLE_HOME = /oracle/product/10.1.3.2.0/OracleAS_1
>> environ: SSH_TTY = /dev/pts/1
>> environ: MAILMSG = [YOU HAVE NEW MAIL]
>> environ: MANPATH = /usr/opt/SUNWmd/man:/usr/man:/usr/local/man:/usr/share/man:
>> environ: NNTPSERVER = time.ornl.gov
>> environ: SSH_CLIENT = 128.219.196.118 64994 22
>> environ: MAIL = /var/mail/de8
>> environ: TZ = US/Eastern
>> environ: PS1 = ${PWD###/} $
>> environ: TERM = vt100
>> environ: PATH = /oracle/product/10.1.3.2.0/OracleAS_1:/oracle/product/10.1.3.2.0/OracleAS_1/OPatch:/usr/xpg4/bin:/usr/ccs/bin:/usr/local/bin:/usr/bin:/usr/ucb:/etc:/usr/sbin:/u00/de8/bin:/opt/NSCPcom:/sbin:/usr/local/etc:/usr/lib:/usr/opt/SUNWmd/sbin:/usr/bin:/usr/local/bin/perl5.00502:/usr/openwin/bin:/opt/sfw/bin:/usr/ImageMagicK/ImageMagick-6.4.4/bin:.:/oracle/product/9.2.0/bin
I decided to output the env vars in hopes that it would show what needs to be reset. But if I use the exact same code in my deployment, it fails and I get the following env settings:
08/12/09 14:14:27 >> environ: XFILESEARCHPATH = /usr/dt/app-defaults/%L/Dt
08/12/09 14:14:27 >> environ: LANG = C
08/12/09 14:14:27 >> environ: DISPLAY = :5
08/12/09 14:14:27 >> environ: ORACLE_CONFIG_HOME = /oracle/product/10.1.3.2.0/OracleAS_1
08/12/09 14:14:27 >> environ: NLSPATH = /usr/dt/lib/nls/msg/%L/%N.cat
08/12/09 14:14:27 >> environ: TMP = /tmp
08/12/09 14:14:27 >> environ: TZ = US/Eastern
08/12/09 14:14:27 >> environ: NLS_LANG = AMERICAN_AMERICA.WE8MSWIN1252
08/12/09 14:14:27 >> environ: ORA_NLS33 = /oracle/product/10.1.3.2.0/OracleAS_1/ocommon/nls/admin/data
08/12/09 14:14:27 >> environ: LD_LIBRARY_PATH = /usr/local/src/oracle/product/10.1.3.2.0/OracleAS_1/jdk/jre/lib/sparc/server:/usr/local/src/oracle/product/10.1.3.2.0/OracleAS_1/jdk/jre/lib/sparc:/usr/local/src/oracle/product/10.1.3.2.0/OracleAS_1/jdk/jre/../lib/sparc:/oracle/product/10.1.3.2.0/OracleAS_1/opmn/lib:/oracle/product/10.1.3.2.0/OracleAS_1/lib32
08/12/09 14:14:27 >> environ: X_LD_LIBRARY_PATH_64 = /oracle/product/10.1.3.2.0/OracleAS_1/lib
08/12/09 14:14:27 >> environ: ORACLE_HOME = /oracle/product/10.1.3.2.0/OracleAS_1
08/12/09 14:14:27 >> environ: SHELL = /bin/bash
Does anyone know how I can get the deployed version (running in the server container) to work exactly in the same way as the version run from a simple command line?

Similar Messages

  • I have created a Flex App with out a Server now I need one

    So I'm new to Flex and didn't think the project needed a
    server at first (poor planning on my part) now I'll need one. I
    have alot built and would like to just conevert the app if I can.
    The project has been sourced in to Subversion, I would like not to
    have to rebuild the repository.
    Thanks for the help

    OK, so I think what you're saying is that you have developed
    locally, which is good, and are using java objects as your back end
    solution - I'll just state that Java is the *only* method of data
    transfer that I haven't used (I use ColdFusion, XML, WEb Services
    mostly), so at some stage I may not be able to help you.
    Still, lets see how far we get. So, you can deploy your SWF
    file to any web server, and browse to it with your browser. The
    output in the /bin directory will include the SWF (usually the name
    of the project) and a html wrapper file.
    Is the Flex app actually rendering (i.e., your containers)
    before you get the error? (I'm trying to determine if the problem
    is the data transfer or the flex app proper)??
    David

  • Debug flex app loaded from remote server

    Hi,
    I'm developing a flex app which gets loaded from a remote
    server and it connects using amf to that server and gets some data.
    Now, I can't test from within the flex builder ide, as the URL will
    be empty. When I test using IE/Firefox pointing to the remote
    server URL where this debug.html is mounted, the swf asks for a
    host ip/name where a flash/flex debugger runs. When I give
    localhost/127.0.0.1, it fails and displays the dialog box again. Is
    there a way to connect the swf from remote server to connect to a
    debug console inside the FB2 ide?

    Well, I ran all commands shipped with FB2and found out that
    fdb does connect and allows to "continue". Still the in IDE
    developing experience and quick turn around isn't there. Is there a
    way to get the URL from which the swf was loaded from within the
    swf, so that if its a remote server, I can get data from it, else
    its in debug state, so I can get data from some hard coded
    host.

  • Creating a Flex App With a PHP Server Connection

    I'm attempting to create a new Flex application that has all of it's source data stored in a mysql database on my server provider (siteground) but am struggling to establish a connection from Flex.
    Basically I click File>New>Flex Project and then name a new project with PHP as the application server type and click next.
    Now comes the problem, I have no idea what to type into the "Root URL" option. I have set the "Web Root" simply to a folder that I've placed on my desktop (sitegroundtest) and Flex seems to recognise that fine but it's just the "Root URL" that I'm struggling with. What exactly would go in here if I want to work directly on the server as opposed to just my local machine (localhost)?
    I'm struggling because I've basically never done this before as I've only ever developed PHP sites in Dreamweaver in which case the sites were all placed on a university server to which all addresses and urls were provided to us.
    The domain name I've purchased is from siteground.com and is www.coolvisiontest.com. Would this have any effect on what needs to be entered into the root url or do I need to look elsewhere for it like within my server provider options or something along those lines?
    It's something that I'm sure is very simple but I have no experience with and I really can't start without finding it out.

    Yep I have used localhost before as I had wamp installed on my computer but I want to work directly from my server provider (siteground.com) where I have set up my mysql database in phpmyadmin, which contains all the sites product details. I know I can work locally using wamp but I want to try to connect to the server to make sure I actually can basically.
    Basically I just can't find the root url I'd need to enter to access siteground via the php server connection and have no idea where to find this. Would you know?
    I think I may also need the same address to access data from tables in the database using Flex's "Data>Create Application from database" connection option. Or would that require another?
    I feel stupid asking this as I'm sure it's really simple but it's just something I've never done before except on my old University server, in which case all required urls for connection were supplied to us and I only ever done this through dreamweaver. Cheers for your help so far.

  • Deployment of Flex app to web and app server

    Hi
    I'm working on putting a Flex front-end on an existing J2EE
    app which gets deployed as an ear file. The architecture consists
    of web server, app server and database server. Is the following
    approach to deployment possible / recommended?
    My Flex app will be deployed to the web server. The J2EE ear
    file will be deployed to the app server (Weblogic). BlazeDS will be
    bundled within the ear file as a war file. Remote Objects will be
    configured in my BlazeDS configuration files to enable me to access
    the code in my J2EE app. In the compiler options of my Flex app,
    I'll be setting the server root folder and server root URL to point
    to the BlazeDS war file on my app server.
    At present I'm at the stage where I can run my Flex app
    directly from Flex builder on my development PC and it's able to
    connect tto the J2EE app, which is running on the app server
    (Weblogic) also on my development PC. I can't find documentation
    explaining how to extend this to work on a multi-tier architecture.
    Thanks
    David

    Hi,
    I replied to your post in FDS forum. Please visit the URL
    below for the response.
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=583&threadid=1373523
    Hope this helps.

  • Flex App with remoting works on local Apache server - fails on production server

    Hi Everyone,
    I have a Flex app that uses Data Services. The application works correctly on my local Mac Server and Apache. When uploaded to my production CentOS server, the Data Services fail. When the app is done loading, the following error message comes up:
    Class "ModelsService" does not exist: Plugin by name 'ModelsService' was not found in the registry; used paths:
    : /www/html/mdubb//PHP2/bin-debug/services/
    #0 /var/www/html/mdubb/ZendFramework/library/Zend/Amf/Server.php(550): Zend_Amf_Server->_dispatch('getAllModels', Array, 'ModelsService')
    #1 /var/www/html/mdubb/ZendFramework/library/Zend/Amf/Server.php(626): Zend_Amf_Server->_handle(Object(Zend_Amf_Request_Http))
    #2 /var/www/html/mdubb/PHP2/bin-debug/gateway.php(73): Zend_Amf_Server->handle()
    #3 {main}
    Where getAllModels is a method of my custom ModelsService.
    I changed the Zend path in the amf_config.ini file so it references the correct directory. If I browse to gateway.php, it prompts to download the file, which I think is correct.
    I added in the config file the path to the services folder.
    I tried adding $server->addClass("ModelServices") in gateway.php, but it didn't like that.
    The file structure on the production server is the same as the local server (I litterally uploaded everything in my local web root), so I can't think of what would be differenet between the two.
    I have already pulled one all nighter trying to get this to run. Do you know what I should troubleshoot next?
    Thanks in advance,
    Ryan

    Hi,
    With reference to Lumira 1.15, the minimal SP we support is BI 4.0 SP6. Please upgrade at least to this. Everything is detailed in the PAM https://websmp107.sap-ag.de/~sapidb/011000358700001095842012E
    Best regards,
    Antoine

  • Flex app can't connect to the internet / server when uploaded?

    I made a simple app that submits a data via POST using the HTTPService. My problem is, when I Run the application from the Flash Builder IDE, and it opens in the browser as a local file, it interacts with my server (remote server) without any problem and does its job well. However, when I upload it to my website, it fails to interact. It displays on the status bar of Firefox that it's connecting to the server that requires interaction but after some time the status reverts to "Done" with my Flex app not showing any Alert boxes if it either succeeded or failed.
    It's really making me frustrated not knowing what's wrong..
    Also if it would be an added help, I decided to use the Flex 3.5 SDK to make it more compatible with commonly installed Flash Players on people's computers since the features that I used doesn't really need those of 4.0.

    Contact the app developer and ask... That's an XML error on the host.

  • Flex App talking to remote LCDS (or blaze or granite) server?

    I've got a Flex app that's running just fine sitting on a Tomcat server, talking to GraniteDS (open source LCDS alternative) that feeds it JMS messages.
    However we're going to need to install the Flex SWF app onto another server entirely (maybe JBoss, who knows) because the SWF actually is just part of the overall web application functionality.
    So is it possible to have the compiled SWF sitting somewhere else other than the LCDS/Granite server?  As I said, when the SWF and the DS server are one and the same, it works fine.  But when I separate the two the SWF app can no longer connect to the DS server (addEventListener returns a Fault).
    There must be some configuration file that the SWF can read at run-time to know what DS server URL to use.  Any ideas?

    One more tidbit.  I modified my services-config.xml and replaced the channel dynamic definition URL that was there (http://{server.name}:{server.port}/{context.root}/gravity/amf) with a hard-coded one http://localhost:8080/gravity/gravity/amf/
    Then I modified my Flex app to no longer try to set the Channel at run time, just to use what's in services-config.xml.  Guess what, it connects just fine.  So the url http://localhost:8080/gravity/gravity/amf/ is absolutely correct - the problem MUST be in the Flex code.  The handler for "MessageFaultEvent.FAULT" keeps firing with the fault from my previous post.
    What about this Flex code is wrong?
    myChannelSet = new ChannelSet();
    myChannel = new AMFChannel("my-gravityamf", "http://localhost:8080/gravity/gravity/amf/");
    myChannelSet.addChannel( myChannel );
    // Define Producer
    producer = new org.granite.gravity.Producer();
    producer.addEventListener(MessageFaultEvent.FAULT, faultHandler);
    producer.addEventListener(MessageEvent.RESULT, faultHandler);
    producer.destination = "messages-destination";
    producer.channelSet = myChannelSet;
    // Define Consumer
    consumer = new org.granite.gravity.Consumer();
    consumer.addEventListener(MessageAckEvent.ACKNOWLEDGE, acknowledgeHandler);
    consumer.addEventListener(MessageEvent.MESSAGE, messageHandler);
    consumer.destination = "events-destination";
    consumer.subscribe();
    producer.send("LOGIN");

  • Flex app doesn't work when moved from original location

    I'm trying to make an image gallery in flex. It works when I run it in Flex Builder perfectly fine. The html and swf files from the bin-debug folder work perfectly fine when opened in any browser also, but ONLY when those files and all related files are opened from the default location that the application was built in. When I export a build to a different folder, the swf loads but none of the information from the xml file displays. I tried setting all of the paths of the reference files (namely the xml) in the flex app to the exact absolute location on the server, and it still didn't work when I uploaded it to the server.
    I've tried several approaches starting from scratch and they have all come up with the same issue. I'm working with an educational license for Flex Builder, I'm not sure if they jip you on those and ruin the compiled swf.
    Please help! I'm losing my mind over this.I think it has to do with something else besides the code since it works fine when I hit "Run", but if anyone thinks it will help to post the code let me know.

    when you build an application using one of the wizards (like coldfusion flex application wizard) it hard codes
    paths to cold fusion CFC's, and sometimes gets it wrong.
    If your application references cfc's (or other remote objects) then it may be necessary to adjust the flex code
    when moving the code into a different base folder.
    For example in my own application, the url is http://localhost/crm_dev_flex and the built application gets put into
    c:\inetpub\wwwroot\crm_dev_flex\bin-debug
    References in the code to components found in c:\inetpub\wwwroot\crm_dev_flex\bin-debug\components\cfgenerated
    (in the flex code these looks like crm_dev_flex.bin-debug.components.cfgenerated.<mycomponent> )
    These need to change when you move the code to somewhere else.
    Also, if you are using wizard generated cfc's then these also contain similar references that need to be changed.
    IHTH.
    Cheers

  • I have a production mobile Flex app that uses RemoteObject calls for all data access, and it's working well, except for a new remote call I just added that only fails when running with a release build.  The same call works fine when running on the device

    I have a production mobile Flex app that uses RemoteObject calls for all data access, and it's working well, except for a new remote call I just added that only fails when running with a release build. The same call works fine when running on the device (iPhone) using debug build. When running with a release build, the result handler is never called (nor is the fault handler called). Viewing the BlazeDS logs in debug mode, the call is received and send back with data. I've narrowed it down to what seems to be a data size issue.
    I have targeted one specific data call that returns in the String value a string length of 44kb, which fails in the release build (result or fault handler never called), but the result handler is called as expected in debug build. When I do not populate the String value (in server side Java code) on the object (just set it empty string), the result handler is then called, and the object is returned (release build).
    The custom object being returned in the call is a very a simple object, with getters/setters for simple types boolean, int, String, and one org.23c.dom.Document type. This same object type is used on other other RemoteObject calls (different data) and works fine (release and debug builds). I originally was returning as a Document, but, just to make sure this wasn't the problem, changed the value to be returned to a String, just to rule out XML/Dom issues in serialization.
    I don't understand 1) why the release build vs. debug build behavior is different for a RemoteObject call, 2) why the calls work in debug build when sending over a somewhat large (but, not unreasonable) amount of data in a String object, but not in release build.
    I have't tried to find out exactly where the failure point in size is, but, not sure that's even relevant, since 44kb isn't an unreasonable size to expect.
    By turning on the Debug mode in BlazeDS, I can see the object and it's attributes being serialized and everything looks good there. The calls are received and processed appropriately in BlazeDS for both debug and release build testing.
    Anyone have an idea on other things to try to debug/resolve this?
    Platform testing is BlazeDS 4, Flashbuilder 4.7, Websphere 8 server, iPhone (iOS 7.1.2). Tried using multiple Flex SDK's 4.12 to the latest 4.13, with no change in behavior.
    Thanks!

    After a week's worth of debugging, I found the issue.
    The Java type returned from the call was defined as ArrayList.  Changing it to List resolved the problem.
    I'm not sure why ArrayList isn't a valid return type, I've been looking at the Adobe docs, and still can't see why this isn't valid.  And, why it works in Debug mode and not in Release build is even stranger.  Maybe someone can shed some light on the logic here to me.

  • Why would I need to use LiveCycle Data Services in a Flex app?

    I cannot figure out what additional functionality is provided by using LiveCycle Data Services in my Flex apps.  I cannot get a clear understanding of how using LiveCycle Data Services would benefit my applications.  Does someone out there use LiveCycle Data Services?  If so, what do you do with it in Flex?
    Thanks!

    - data push for publish/subscribe implementations
    User has to do nothing to get updated information. You push it to their machine when new data is available, like Yahoo finance updated quotes.
    - data paging
    You don't want to display one million rows in your datagrid at once. Get a batch of data, if the user scrolls down, get the next batch, etc.
    - server side clustering
    One server does not get overloaded. High traffic sites have their large number of concurrent connections managed more efficiently.
    - JMS services
    JMS is a powerful technology for messaging throughout an application, and LCDS makes it much easier.
    - RTMP tunneling
    Allows the use of the RTMP protocol in LiveCycle Data Services applications. Makes it easier to traverse firewalls and proxies appropriately that currently prevent direct RTMP client connections to the server.
    If this post answered your question or helped, please mark it as such.

  • Using Weblogic to Deploy Simple Flex App

    Hi,
       I am trying to deploy a simple Flex application in a weblogic8.1  server , so that I can use it locally.
    Can any one please guide me where and how I have to deploy my flex app .
    I am pretty new to this can any body provide me a guide or walk through step wise for me.
    More over What is the url I need to give in the browser to access the flex app I deploy in the Weblogic server.
    (At present I am using the IIS -- just copying the .swf file and wrapper html page in to the C:\Inetpub\wwwroot and giving http://localhost/test.html
    in the browser to access it) ---  How do I do this using Weblogic 8.1
    thanks
    Nash

    Hi again Nash,
    the stuff I am doing at present is not yet permitted to be publicly available, but the principles are very straightforward. Remember that WebLogic is primarily concerned with server-side functionality and Flex with client-side, so there is not really a great deal of overlap. The place where your Flex instantiation code will sit is in one or other JSP, using code very like the templates that Adobe generate. The only thing you have to do is ensure that your JSP (or the controller/code files behind it) generate HTML that contains the necessary. I tend to use the Apache Beehive libraries for UI stuff, but from vague memory I don't think these were around in WL8 - however, it doesn't really matter what tag library you prefer as all you are doing is generating HTML that looks like the usual JavaScript calls to AC_FL_RunContent (or swfobject if you are using that method). Basically, just take the Adobe-generated template and wrap the necessary bits and pieces round the edge to make it a proper JSP.
    When you need to make calls to get functionality, just use something like
                        service = new HTTPService();
                        separator_date = new Date();
                        service.url = "get_tool_list.jsp?sep=" + separator_date.valueOf();
                        service.addEventListener(FaultEvent.FAULT , fault_handler);
                        service.addEventListener(ResultEvent.RESULT, resultHandler);
                        service.resultFormat = "text";
                        CursorManager.setBusyCursor();
                        service.requestTimeout = WEB_SERVICE_TIMEOUT;
                        service.send();
    and then inside get_tool_list.jsp (or whatever...) do the server-side functionality you need, and return the result in a suitable format that the Flex resultHandler method can then interpret and make use of.
    Hope that helps,
    Richard

  • HTTP request logger/simulator for flex app

    I have a server that provides input xml data to a flex app in a browser be displayed on the screen for editing over http. Can someone suggest a way to cache and simulate this server's response? I need the flex app in the browser to work even when the server is down (for testing and UI dev). Any tools or ideas that I may be able to use?
    Thx

    just point your HTTPService tag to any local xml file having static data snapshot using url attribute
    If you feel this message answers your question or helps, please mark it respectively

  • Deploy Flex app

    I'm using FB3 to build and release Flex app. Copy the
    bin-debug directory out of the workspace and change the directory
    name, make a zip file from the directory.
    Upload the zip file to the server and unzip the file.
    FB3 creates a html wrapper for the swf file. Is accessing the
    swf file directly better than going through the HTML
    wrapper?

    This is actually more of a SAP J2EE engine question as there
    may be some set up that it keeping it from accessing the correct
    jar files. I'm not sure how the SAP J2EE works, but it has tomcat,
    the solution might be found here:
    http://forum.java.sun.com/thread.jspa?threadID=487257&messageID=2283292
    The mx4j-jmx.jar probably has your missing files. You can
    download it here (
    http://mx4j.sourceforge.net/)
    and see if that works.

  • Configuring socket policy for flex apps(with blocked port 843)?

    We have built several flex-based ecommerce apps for a fortune 500 customer of ours, that for various reasons, we need to use sockets to a different domain and requires a socket policy file, but were having trouble configuring our flex apps for deployment in thier enviornment where they are blocking virtually everything except port 80 . The current documentation in in regards to socket policy files and crossdomain files in a non-standard configuration not using port 843 is not providing any useful help to us.
    Here is the scenario:
    Flex apps are served from domain www.a.com in  to users browsers via http. The apps then make socket connections to domain www.b.com:80 where there are php scripts serving json data to the flex apps via port 80 using http(we use sockets because we need to set and read back http headers). The problem is the flex apps cannot make socket connections to the www.b.com domain without errors like below(unless we setup a socket policy server on port 843 of www.b.com, in which case everything works):
    Warning: Timeout on xmlsocket://www.b.com:80 (at 3 seconds) while waiting for socket policy file.  This should not cause any problems, but see http://www.adobe.com/go/strict_policy_files for an explanation.
    Error: Request for resource at xmlsocket://www.b.com:80 by requestor from http://www.a.com/bin-debug/DownloadManagerFlex.swf is denied due to lack of policy file permissions.
    Error: Request for resource at xmlsocket://www.b.com:80 by requestor from http://www.a.com.us/bin-debug/DownloadManagerFlex.swf is denied due to lack of policy file permissions.
    Since we cannot use port  843 for the socket policy file server, we setup the socket policy server on a different ip in the same domain: spf.b.com:80 (using the sample perl code Adobe provides), and per the docs(cited below), use Security.loadPolicyFile("xmlsocket://spf.b.com:80") before we invoke "socket.connect", to supposedly tell the flash player to check there for the socket policy file. The problem, as you can see from the error log, is that the  loadPolicyFile("xmlsocket://spf.b.com:80") is ignored.
    No matter what we do or how we set things up, we cannot get the flash player to recognize the loadPolicyFile(), it always wants to go to the port were making the socket connection on. It is unclear how to properly configure the flex app, socket policy file and crossdomain file for the above scenario. The docs allude to being able to serve  the socket policy file from a different port 80 in the same domain as the socket connection were trying to make, but were having no luck with that.
    ->Can anyone shed some light on how to make this work or what are we  missing/doing wrong? Also, if we can get this to work, are we  stuck with a 3 second delay because this(very large) customer is blocking port 843?
    As an aside,  the documentation for all this is a bit scattered, unclear and contrdictory:
    One document says:(http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security_07.html)
    "This warning usually means one of two things: first, that you need to set up a
                socket policy file server on port 843, which is the first location that Flash
                Player checks by default; or second, that you need to provide more explicit
                guidance to Flash Player from ActionScript by calling loadPolicyFile to indicate the location
                of a socket policy file. When you call loadPolicyFile rather than allowing Flash Player to check
                locations by default, Flash Player will wait as long as necessary for a
                response from a socket policy file server, rather than timing out after 3
                seconds."
    Another document says(http://www.adobe.com/devnet/flashplayer/articles/socket_policy_files.html):
    "If an ActionScript Security.loadPolicyFile() command exists within               the SWF file, then the Flash Player runtime checks that location. Flash Player checks               the destination of the loadPolicyFile() only after it has checked the               master policy file on port 843 for permission to acknowledge other policy               files. If the developer has not specified a loadPolicyFile() command,               then Flash Player checks the destination port of the connection."

    I found the reason why the Flex application was ignoring the socket policy (crossdomain.XML). I have a policy server that listens to port 843 and submits the policy to the Flex client. My policy was getting ignored by the Flex application and I was getting the sandbox security error you were getting. The solution to this problem isto write a null byte right after the policy server sends the policy. I'm using Apache Mina that is wrtten is Java and the null byte is written as follows:
    public void sessionCreated (IoSession session)
            throws Exception
            session.write(_policy);  -- > policy string
            session.write("\u0000"); --> null byte
             //session.close(true); ---> No need to close the session because it is closed by the Flex client after it receives the null byte.
    Now my Flex application can read and accept the policy from port 843 and I'm not getting more security violations.
    Thanks for your reply,
    Alberto

Maybe you are looking for

  • My country is not listed in the Mac app store and iTunes?

    My country is not listed in the Mac app store or iTunes. and yes ive tried putting in false information like 'I live in the USA, NY' but whenever i try buying something it says "Your credit card information does not match your banks records, Please e

  • Grouping data for specific requirement

    Despite my initial efforts, I have been unable to solve a problem with a report written in SQL. The data I have is as follows: Territory  Name                        Order #  Description                           Qty  Order total OKMGAS008  James Coo

  • OVD Related Queries

    Hi Can someone let me know the feasibility of achieving the following with OVD i)     Configuring two OID's, on different domains, say 'xyz.com' and 'xyz.co.in' with a single OVD Server, i.e. OVD should be able to fetch data from both of these direct

  • Newby question - sorry - Velocity/volume confusion - my head

    Hello! Sorry about this. If it's any consolation, I have tried searching for the answer, but I'm still none the wiser. I've played some midi stuff in, and now I want to fade out some notes at the end of a region. Firstly, how does one change the VOLU

  • Simple program wont run  java.lang.NoClassDefFoundError

    Exception in thread "main" java.lang.NoClassDefFoundError: Server (wrong name: Simple_Server/Server) i am new to java and i made this simple script to accept connections then pass them on to HandleClient. but when i run it i get this output Exception