Skip navigation
Currently Being Moderated

Help with flex4unit ant build.xml: Socket timeout waiting for flexunit report

Oct 11, 2009 7:03 PM

I'm having trouble setting up ant to build and test my project locally and I'm not sure what the next step is.



  • Running on XP/Cygwin.
  • All of the files that FlexUnit4 references when used in Flash Builder are in my '${basename}/libs' folder (eg FlexUnit4_1.0.swc).
  • I've placed the flexunit4 task in my ant/libs folder.


I'm getting two errors...


I don't think I've set up the 'socket' stuff right for the tests. It just sits and waits then dies...


 [flexunit] Waiting for client connection ...
 (about a minute later)
 [flexunit] Stopping server ...
 [flexunit] End of test data reached, sending acknowledgement to player ...
 [flexunit] Closing client connection ...
 [flexunit] Closing server on port [1024] ...

java.util.concurrent.ExecutionException: Socket timeout waiting for flexunit report


Plus this is the error I get from the flash player:


ReferenceError: Error #1065: Variable mx.skins.spark::BorderSkin is not defined.


I don't know why it's complaining about Borderskin as I think I have included all the flex4 libs I could find. I suspect this second error is causing the first error?



Any help appreciated. I think I'm just setting it up all wrong.


Screencap of errors:



  • Currently Being Moderated
    Oct 11, 2009 8:26 PM   in reply to timoxley

    @timoxley - Try changing your test runner to compile linking in the Flex libraries rather than externalizing them.  The Ant task is goint to try and execute your SWF outright rather loading it at runtime as a module, so your SWF needs to have everything its depends on linked into it; the Error #1065 is an error from the FP that a class definition is missing (from what I could tell).  I think the following change may help:


    <mxmlc file="${SRC_FOLDER}/FlexUnitApplication.mxml" keep-generated-actionscript="false" output="${OUTPUT_FOLDER}/${}Tests.swf">
                 <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
                 <source-path path-element="${FLEX_HOME}/frameworks"/>
                 <compiler.library-path dir="${FLEX_HOME}" append="true">
                     <include name="frameworks/libs" />
                 <compiler.library-path dir="${basedir}" append="true">
                     <include name="libs" />

    If that doesn't work out, then check your test runner code to make sure it's adding the CIListener class to the core before the test suite(s) is being executed.  Hope this helps.

    Mark as:
  • Currently Being Moderated
    Oct 12, 2009 7:25 AM   in reply to timoxley

    @timoxley - Couple notes to add:


    - You can use the release stand-alone or debug stand-alone Flash Player to use the FlexUnit4 Ant task.  The key to getting the Flash Player to run is associating the SWF mimetype (application/x-shockwave-flash) with the stand-alone Flash Player executable (if you're running on Mac or Windows) in your OS.  On Windows we use rundll32 to launch the associated player for the SWF mimetype and on the Mac we use the "open" command.  On Linux, you need to make sure a symlink for the flashplayer executable you want to use is created with a name of "gflashplayer" and is available on the user's path.  These are all reminents of the FU1 Ant task, so if needed we can refactor this out for a more standardized approach if people would like.


    - If you would not like to setup an evironment variable for FLEX_HOME, based on the build script you've provided, you can pass the following argument to Ant:  -Denv.FLEX_HOME=/full/path/to/your/SDK


    Hopefully we'll have the Flex 4 build fixed in the coming months so people can d/l a zip like they can for the other SDK versions; the only project giving us trouble with the build is the UIRunner project.


    Thanks for putting the work into an example using the current environment, hopefully we can make it easier going forward.



    Mark as:
  • Currently Being Moderated
    Oct 21, 2009 12:11 PM   in reply to legrosb



    I have also ran into the issue with "java.util.concurrent.ExecutionException: Socket timeout waiting for flexunit report".  In my case, I had a Flex project with FlexUnit 4 tests and an ant script to drive the compile, testing, reporting, etc. All of this was running successfully with the latest FlexUnit 4 from SVN on my Windows XP desktop machine.  I moved the entire project over to a Windows Server 2003 machine to test there, and have been running into the socket timeout when the <flexunit> ant task tries to launch the flash player.


    Brian, your comment about "associating the SWF mimetype (application/x-shockwave-flash) with the stand-alone Flash Player executable" is perhaps the key to what causes the trouble.  The Windows Server OS did not have flash installed, so I opted to install the debug flash player that was embedded in the FlashSDK3.4 that I am using (I used the debug player on my desktop machine also).  On my desktop machine, I can browse the TestRunner.SWF file that the compile produces and see that it is of type "Shockwave Flash Object".  But on the server machine, there is no such association. 


    The question is: why did the flash player installer not create the association on Windows Server? I think I had the non-debug version of flash installed on my desktop, and I uninstalled that prior to switching to the debug player there, so that is why I did not notice any issues on my desktop.


    I fixed the problem on Windows Server by manually trying to open the SWF and telling Windows to use the player executable under the FlexSDK3.4.  Now I can get successful launches of the player with the <flexunit> task.


    But someone might want to look into the debug player install...




    Mark as:
  • Currently Being Moderated
    Oct 21, 2009 12:29 PM   in reply to trevorbutler

    @trevorbutler - Good question for the FP team, I'm not really sure of the answer.  To clarify though, you don't need the debug FP to use the FU4 Ant task.  You do need the standalone player, but there is a release player that comes in standalone/projector form.   I will make sure the README.txt in the sample project make a note of this behavior on Windows to help prevent others from running into this.  Thanks for the help.

    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