9 Replies Latest reply on Apr 25, 2010 10:55 PM by smmoonshoes

    Error parsing report

    smmoonshoes

      Hi all,

       

      I'm having trouble getting the Ant task working in Linux.   The swf runs, but there seems to be an issue communicating back the test results.  I pasted a full dump of the ant output below.  I've tried it in both Fedora 8 and OpenSUSE 11.2, and with both the FlexUnit4SampleCIProject and my own project.   I also tried the updated .jar and .swc mentioned in this post.  I'm using Ant directly without Hudson or anything.

      I'm also having a hard time running headlessly, but I'm assuming that's a separate issue.

       

      Any help would be greatly appreciated.

       

      - Shane

       

      #########

       

      shane@linux-idnf:~/Download/flexunit-flexunit-91fcfdd/FlexUnit4SampleCIProject> ant clean package

      Unable to locate tools.jar. Expected to find it in /usr/lib/jvm32/jre1.6.0_18/lib/tools.jar

      Buildfile: build.xml

       

      clean:

         [delete] Deleting directory /home/shane/Download/flexunit-flexunit-91fcfdd/FlexUnit4SampleCIProject/target

       

      init:

          [mkdir] Created dir: /home/shane/Download/flexunit-flexunit-91fcfdd/FlexUnit4SampleCIProject/target

          [mkdir] Created dir: /home/shane/Download/flexunit-flexunit-91fcfdd/FlexUnit4SampleCIProject/target/bin

          [mkdir] Created dir: /home/shane/Download/flexunit-flexunit-91fcfdd/FlexUnit4SampleCIProject/target/report

          [mkdir] Created dir: /home/shane/Download/flexunit-flexunit-91fcfdd/FlexUnit4SampleCIProject/target/dist

       

      compile:

          [mxmlc] Loading configuration file /usr/lib/flex_sdk/frameworks/flex-config.xml

          [mxmlc] /home/shane/Download/flexunit-flexunit-91fcfdd/FlexUnit4SampleCIProject/target/bin/Main.s wf (326989 bytes)

       

      test:

          [mxmlc] Loading configuration file /usr/lib/flex_sdk/frameworks/flex-config.xml

          [mxmlc] /home/shane/Download/flexunit-flexunit-91fcfdd/FlexUnit4SampleCIProject/target/bin/TestRu nner.swf (852432 bytes)

      [flexunit] Validating task attributes ...

      [flexunit] Generating default values ...

      [flexunit] Using the following settings:

      [flexunit] haltonfailure: [false]

      [flexunit] headless: [false]

      [flexunit] display: [99]

      [flexunit] localTrusted: [true]

      [flexunit] player: [flash]

      [flexunit] port: [1024]

      [flexunit] swf: [/home/shane/Download/flexunit-flexunit-91fcfdd/FlexUnit4SampleCIProject/target/bin/TestR unner.swf]

      [flexunit] timeout: [60000ms]

      [flexunit] toDir: [/home/shane/Download/flexunit-flexunit-91fcfdd/FlexUnit4SampleCIProject/target/report]

      [flexunit] verbose: [true]

      [flexunit] Setting up server process ...

      [flexunit] Starting server ...

      [flexunit] OS: [Linux]

      [flexunit] Opening server socket on port [1024].

      [flexunit] Waiting for client connection ...

      [flexunit] Launching player:

      [flexunit] Executing 'gflashplayer' with arguments:

      [flexunit] '/home/shane/Download/flexunit-flexunit-91fcfdd/FlexUnit4SampleCIProject/target/bin/TestR unner.swf'

      [flexunit]

      [flexunit] The ' characters around the executable and arguments are

      [flexunit] not part of the command.

      [flexunit]

      [flexunit] Client connected.

      [flexunit] Setting inbound buffer size to [262144] bytes.

      [flexunit] Receiving data ...

      [flexunit] Sending acknowledgement to player to start sending test data ...

      [flexunit]

      [flexunit] <testcase classname="org.flexunit.demo::EchoPanelTest" name="testEventWasNotDispatchedWithoutClick" time="0" status="success" />

      [flexunit]

      [flexunit] Stopping server ...

      [flexunit] End of test data reached, sending acknowledgement to player ...

      [flexunit] Closing client connection ...

      [flexunit] Closing server on port [1024] ...

       

      BUILD FAILED

      java.util.concurrent.ExecutionException: Error parsing report.

      at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)

      at java.util.concurrent.FutureTask.get(Unknown Source)

      at org.flexunit.ant.tasks.FlexUnitTask.execute(Unknown Source)

      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)

      at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

      at java.lang.reflect.Method.invoke(Unknown Source)

      at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)

      at org.apache.tools.ant.Task.perform(Task.java:348)

      at org.apache.tools.ant.Target.execute(Target.java:357)

      at org.apache.tools.ant.Target.performTasks(Target.java:385)

      at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)

      at org.apache.tools.ant.Project.executeTarget(Project.java:1306)

      at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)

      at org.apache.tools.ant.Project.executeTargets(Project.java:1189)

      at org.apache.tools.ant.Main.runBuild(Main.java:758)

      at org.apache.tools.ant.Main.startAnt(Main.java:217)

      at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)

      at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

      Caused by: Error parsing report.

      at org.flexunit.ant.FlexUnitSocketThread.parseReport(Unknown Source)

      at org.flexunit.ant.FlexUnitSocketThread.processTestReport(Unknown Source)

      at org.flexunit.ant.FlexUnitSocketThread.parseInboundMessages(Unknown Source)

      at org.flexunit.ant.FlexUnitSocketThread.call(Unknown Source)

      at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)

      at java.util.concurrent.FutureTask.run(Unknown Source)

      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

      at java.lang.Thread.run(Unknown Source)

      Caused by: org.dom4j.DocumentException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory Nested exception: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory

      at org.dom4j.io.SAXReader.read(SAXReader.java:484)

      at org.dom4j.DocumentHelper.parseText(DocumentHelper.java:278)

      ... 9 more

       

      Total time: 15 seconds

        • 1. Re: Error parsing report
          legrosb Level 3

          @smmoonshoes - Can you provide me with a dump from the Flash Player after the failure of the sample project build?  If you don't have this setup, this article should have what you need:

           

          http://blog.flexexamples.com/2007/08/26/debugging-flex-applications-with-mmcfg-and-flashlo gtxt/

           

          Basically it's dropping a file called mm.cfg in your home directory with a couple of properties.  That should create a flashlog.txt file that can tell me what things look like before they get to the Ant side.

           

          Just want to make sure I have a baseline.  Could you also verify you're using the stock sample project with no changes?  I've never tested on Fedora or OpenSUSE; I've only gotten it working on Ubuntu.  Can you make sure you have all of the dependencies for the FP installed as well?  Here is a list I found in the Adobe KB:  http://kb2.adobe.com/cps/153/tn_15380.html.  Are you using FP 10 standalone debugger or the standard standalone player?  Just some questions to help me flush out what's causing the problem.

           

          What issues were you running into when running headlessly?  Any gtk errors?  Are you running on a box with/without X Windows installed?  Were you using Xvnc, xvfb, or the built in support for the Ant task?

           

          Let me know and I'll help you to get up and running as best I can.

           

          -Brian

          • 2. Re: Error parsing report
            smmoonshoes Level 1

            @legrosb Only one line shows up in flashlog.txt:

            <testcase classname="org.flexunit.demo::EchoPanelTest" name="testEventWasNotDispatchedWithoutClick" time="0" status="success" />

             

            I'm sure I made some changes to the sample project yesterday, so I set up a fresh copy just now (which didn't help).

             

            I do have an Ubuntu box handy if you think it'd be worth a try there.  Headless on the Fedora box is the ultimate goal, though.

             

            I'm using the flash player 10 standalone debugger (I tried the standalone standard player, too).  I do have all the dependencies listed for Flash Player 10 on the page you linked.

             

             

            When I try running headlessly, the ant task hangs for a while and then quits with the message "Socket timeout waiting for flexunit report" (Ant dump below).  As far as I can tell, the flash player is never actually being launched.  No flashlog.txt is generated, and I don't see gflashplayer show up in "top".  I tried attaching vncviewer to :99, but it goes up and down so quickly it's hard to attach and see what's going on.

             

            I'm not seeing any gtk errors in the Ant output. Is there a log file I should be looking at?

            Interesting.  If start a build of the sample project, then open up a separate terminal, set DISPLAY=:99, and run gflashplayer within the second or so that the vnc server is actually running, I get:

            shane@linux-idnf:~/Download/flexunit-clean/FlexUnit4SampleCIProject> gflashplayer

            WARNING: environment variable G_FILENAME_ENCODING set and it is not UTF-8

            Xlib:  extension "RANDR" missing on display ":99.0".

             

            gflashplayer: Fatal IO error 11 (Resource temporarily unavailable) on X server :99.0.

            Segmentation fault

             

            The Fedora box is a headless server, but I installed X Windows and vnc-server on it for this.  The OpenSUSE box is a normal desktop machine.

             

            "Were you using Xvnc, xvfb, or the built in support for the Ant task?"

            I'm not sure.  I set headless="true" in the <flexunit /> task, which causes it to call vncserver (which calls Xvnc, I think?).

             

            Aha.  I found a workaround.  I set headless="false" in the build.xml, and before calling ant, I ran:

            $ vncserver :150

            $ DISPLAY=:150

            And everything works beautifully (until it gets to the other error, that is).

             

            Another issue I ran into that others might want to watch out for is if your vnc server is using twm, twm might be configured to wait for the user specify the window position with the mouse, which means flash will never launch on a headless server.  The fix is to add the line "RandomPlacement" to your ~/.twmrc, or specify a different window manager in ~/.vnc/xstartup.

             

            - Shane

             

             

            ####Broken headless Ant dump#####

            shane@linux-idnf:~/Download/flexunit-clean/FlexUnit4SampleCIProject> ant clean package

            Unable to locate tools.jar. Expected to find it in /usr/lib/jvm32/jre1.6.0_18/lib/tools.jar

            Buildfile: build.xml

             

            clean:

              [delete] Deleting directory /home/shane/Download/flexunit-clean/FlexUnit4SampleCIProject/target

             

            init:

                [mkdir] Created dir: /home/shane/Download/flexunit-clean/FlexUnit4SampleCIProject/target

                [mkdir] Created dir: /home/shane/Download/flexunit-clean/FlexUnit4SampleCIProject/target/bin

                [mkdir] Created dir: /home/shane/Download/flexunit-clean/FlexUnit4SampleCIProject/target/report

                [mkdir] Created dir: /home/shane/Download/flexunit-clean/FlexUnit4SampleCIProject/target/dist

             

            compile:

                [mxmlc] Loading configuration file /usr/lib/flex_sdk/frameworks/flex-config.xml

                [mxmlc] /home/shane/Download/flexunit-clean/FlexUnit4SampleCIProject/target/bin/Main.swf (326985 bytes)

             

            test:

                [mxmlc] Loading configuration file /usr/lib/flex_sdk/frameworks/flex-config.xml

                [mxmlc] /home/shane/Download/flexunit-clean/FlexUnit4SampleCIProject/target/bin/TestRunner.swf (852432 bytes)

            [flexunit] Validating task attributes ...

            [flexunit] OS: [Linux]

            [flexunit] Generating default values ...

            [flexunit] Using the following settings:

            [flexunit] haltonfailure: [false]

            [flexunit] headless: [true]

            [flexunit] display: [99]

            [flexunit] localTrusted: [true]

            [flexunit] player: [flash]

            [flexunit] port: [1024]

            [flexunit] swf: [/home/shane/Download/flexunit-clean/FlexUnit4SampleCIProject/target/bin/TestRunner.swf]

            [flexunit] timeout: [60000ms]

            [flexunit] toDir: [/home/shane/Download/flexunit-clean/FlexUnit4SampleCIProject/target/report]

            [flexunit] verbose: [true]

            [flexunit] Setting up server process ...

            [flexunit] Starting server ...

            [flexunit] Opening server socket on port [1024].

            [flexunit] Waiting for client connection ...

            [flexunit] OS: [Linux]

            [flexunit] Starting xvnc

            [flexunit] Attempting start on :99 ...

            [flexunit] Launching player:

            [flexunit] Executing 'gflashplayer' with arguments:

            [flexunit] '/home/shane/Download/flexunit-clean/FlexUnit4SampleCIProject/target/bin/TestRunner.swf'

            [flexunit]

            [flexunit] The ' characters around the executable and arguments are

            [flexunit] not part of the command.

            [flexunit]

            [flexunit] Terminating xvnc on :99

            <<<Hangs here for about a minute>>>

            [flexunit]

            [flexunit] Stopping server ...

            [flexunit] End of test data reached, sending acknowledgement to player ...

            [flexunit] Closing client connection ...

            [flexunit] Closing server on port [1024] ...

             

            BUILD FAILED

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

            at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)

            at java.util.concurrent.FutureTask.get(Unknown Source)

            at org.flexunit.ant.tasks.FlexUnitTask.execute(Unknown Source)

            at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)

            at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

            at java.lang.reflect.Method.invoke(Unknown Source)

            at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)

            at org.apache.tools.ant.Task.perform(Task.java:348)

            at org.apache.tools.ant.Target.execute(Target.java:357)

            at org.apache.tools.ant.Target.performTasks(Target.java:385)

            at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)

            at org.apache.tools.ant.Project.executeTarget(Project.java:1306)

            at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)

            at org.apache.tools.ant.Project.executeTargets(Project.java:1189)

            at org.apache.tools.ant.Main.runBuild(Main.java:758)

            at org.apache.tools.ant.Main.startAnt(Main.java:217)

            at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)

            at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

            Caused by: Socket timeout waiting for flexunit report

            at org.flexunit.ant.FlexUnitSocketServer.start(Unknown Source)

            at org.flexunit.ant.FlexUnitSocketThread.call(Unknown Source)

            at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)

            at java.util.concurrent.FutureTask.run(Unknown Source)

            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

            at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

            at java.lang.Thread.run(Unknown Source)

            Caused by: java.net.SocketTimeoutException: Accept timed out

            at java.net.PlainSocketImpl.socketAccept(Native Method)

            at java.net.PlainSocketImpl.accept(Unknown Source)

            at java.net.ServerSocket.implAccept(Unknown Source)

            at java.net.ServerSocket.accept(Unknown Source)

            at org.flexunit.ant.FlexUnitSocketServer.openClientSocket(Unknown Source)

            ... 7 more

             

            Total time: 1 minute 13 seconds

            • 3. Re: Error parsing report
              legrosb Level 3

              @smmoonshoes - Thanks for the tip on twm; I had spent hours on a different project trying to get it to work and eventually just changed out the window manager to get it working.  Your tip for twm is great though; would you mind adding it to our wiki?

               

              http://docs.flexunit.org/index.php?title=Continuous_Integration_Support

               

              In terms of the build, is it possible to start from scratch with the OS installation?  I noticed that Fedora 12 is the latest incarnation, did you verify that the FP is supported on Fedora 8?  I noticed the same with OpenSUSE, 11.2 is out.  I'm throw together a virtual machine running the latest Fedora or OpenSUSE distro and put together a setup guide.  The process usually takes me a few hours and this weekend is probably the first opportunity I'll have, so I'll let you know how it goes.  Are you running 32 or 64 bit?

               

              As far as the headless builds, the Ant task is spawning an Xvnc session on display 99, doing exactly what you tried manually (vncserver :99, export DISPLAY=:99, vncserver -kill :99); you can find more details @ http://docs.flexunit.org/index.php?title=Ant_Task.  The error you're seeing is from the the Flash Player not spawning.  If the session opens and closes right away, then I'll have to give it a shot on a VM with Fedora as well to see what's going on.  I'll try adding some more debugging code to the Xvnc integration going forward to make finding these issues easier.  With a VM for Fedora, at the very least we'll have some better luck with testing.

               

              I'll let you know if I find anything this weekend.  Let me know about the OS architecture(s) you're running.

               

              -Brian

              • 4. Re: Error parsing report
                legrosb Level 3

                @Shane - Looks like Fedora 8 might not be on the supported list from Adobe for the FP:

                 

                http://www.adobe.com/products/flashplayer/systemreqs/index.html#os

                 

                I know I've gotten it working on CentOS, but did Fedora 8 come after RHEL 5?  Sorry I'm not that familiar with Linux distros and their heritage, so let me know if this is a roadblock.

                 

                -Brian

                • 5. Re: Error parsing report
                  smmoonshoes Level 1

                  @Brian - I updated the wiki with the RandomPlacement trick.  I also removed the bit mentioning the -s option after I tried it and it didn't work.

                   

                  I can't do a fresh OS install on the Fedora machine as it's also a production web server.  Setting up a new machine from scratch might be an option if it comes to that.  Having a CI server and production web server sharing a machine probably isn't the best setup anyway.  The OpenSUSE machine is a desktop machine, so I can't use that as a CI server.  That Ubuntu machine I mentioned might work, though.  I'll try getting this set up there.  But, I probably won't get to that until this weekend either.

                   

                  Regarding the the Linux distro heritage, I have no idea either.

                   

                  Architectures:

                  Fedora 8: i686

                  OpenSUSE: x86_64 (But with a 32 bit JVM)

                  Ubuntu 8.04: i686

                   

                  -Shane

                  • 6. Re: Error parsing report
                    legrosb Level 3

                    @Shane - Yeah I would strongly discourage sharing resources with your CI machine.  As you add builds, they tend to eat up lots of resources while building and testing that starve other processes.  I'd definteily suggest using a separate box.  I've had success getting all of my integration tests to work on Ubuntu, so if you have it available, definitely can't hurt to give it a shot.  I'd recommend giving Hudson running on Tomcat a try as well.  It's the simplest CI server product I've used and easily usable as a WAR.  Consequently, ll hold off on the Fedora test this weekend since you're going a different direction.

                     

                    Thanks again for helping to update the wiki as well.  We're really starting to build up a nice chunk of knowledge re: the process.

                     

                    -Brian

                    • 7. Re: Error parsing report
                      smmoonshoes Level 1

                      @Brian - Switching to Ubuntu did the trick.  I'm up and running.  Thanks for help, Brian.

                      Should I file bug reports in jira for the xml parse error and/or for the headless timeout issue?

                      FYI: I did have to use the workaround for the headless issue in Ubuntu as well.

                       

                      - Shane

                      • 8. Re: Error parsing report
                        legrosb Level 3

                        @Shane - The xml parse error seems to be specific to your installation since I haven't been able to reproduce for CentOS or Ubuntu.  That being said, I should really beef up the integration tests to be run as a bundle so I can test them on a series of Linux distros (Fedora, OpenSUSE, etc).  The headless bug though may something I need to fix; if you'd like to file a bug for that I'd appreciate it.  Best of luck, let us know if we can help with anything else.


                        -Brian