You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Eric Fetzer <el...@yahoo.com> on 2010/08/19 03:39:16 UTC

Build Flex in a Headless Environment

Hi!  I'm very new to Maven and trying to build a flex client in a headless 
environment.  As long as I export my display, I get no issues.  However, I need 
to be able to do this headless so that it can be done in an automated fasion.  
I'm running:

[root@newark rossPrototype-client]# mvn -version
Apache Maven 2.2.1 (r801777; 2009-08-06 13:16:01-0600)
Java version: 1.6.0_20
Java home: /usr/java/jdk1.6.0_20/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.9-89.el" arch: "i386" Family: "unix"

With Flex 3 and flashplayer 10.  I've tried setting MAVEN_OPTS:  
-Djava.awt.headless=true
I've tried adding to my pom file:

<testRunner>
           <launcher>            
                          <allowHeadlessMode>true</allowHeadlessMode>
           </launcher>           
</testRunner> 

Neither of these things changed anything.  Here is the error I'm getting without 
my display exported based on the command >MAVEN_OPTS="-Djava.awt.headless=true" 
mvn install -X:

____________________________________________________________________________________________________________


[WARNING] [LAUNCHER] Using xvfb-run to launch headless tests
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to launch Flash Player.  Probably java was not able to find 
flashplayer.
                Make sure flashplayer is available on PATH
                or use -DflashPlayer.command=${flashplayer executable}
Read more at: https://docs.sonatype.org/display/FLEXMOJOS/Running+unit+tests
Embedded error: Failed to launch Flash Player in headless environment.
java.io.IOException: error=2, No such file or directory
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to launch Flash 
Player.  Probably java was not able to find flashplayer.
                Make sure flashplayer is available on PATH
                or use -DflashPlayer.command=${flashplayer executable}
Read more at: https://docs.sonatype.org/display/FLEXMOJOS/Running+unit+tests
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)

        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)

        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)

        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)

        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)

        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)

        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at 
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to launch 
Flash Player.  Probably java was not able to find flashplayer.
                Make sure flashplayer is available on PATH
                or use -DflashPlayer.command=${flashplayer executable}
Read more at: https://docs.sonatype.org/display/FLEXMOJOS/Running+unit+tests
        at org.sonatype.flexmojos.test.FlexUnitMojo.run(FlexUnitMojo.java:274)
        at 
org.sonatype.flexmojos.test.FlexUnitMojo.execute(FlexUnitMojo.java:156)
        at 
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)

        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)

        ... 17 more
Caused by: org.sonatype.flexmojos.test.launcher.LaunchFlashPlayerException: 
Failed to launch Flash Player in headless environment.
        at 
org.sonatype.flexmojos.test.launcher.AsVmLauncher.runFlashplayerHeadless(AsVmLauncher.java:149)

        at 
org.sonatype.flexmojos.test.launcher.AsVmLauncher.start(AsVmLauncher.java:77)
        at 
org.sonatype.flexmojos.test.DefaultTestRunner.run(DefaultTestRunner.java:53)
        at org.sonatype.flexmojos.test.FlexUnitMojo.run(FlexUnitMojo.java:262)
        ... 20 more
Caused by: java.io.IOException: Cannot run program "xvfb-run": 
java.io.IOException: error=2, No such file or directory
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
        at java.lang.Runtime.exec(Runtime.java:593)
        at java.lang.Runtime.exec(Runtime.java:466)
        at 
org.sonatype.flexmojos.test.launcher.AsVmLauncher.runFlashplayerHeadless(AsVmLauncher.java:142)

        ... 23 more
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or 
directory
        at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
        at java.lang.ProcessImpl.start(ProcessImpl.java:65)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
        ... 26 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 minute 20 seconds
[INFO] Finished at: Wed Aug 18 19:37:03 MDT 2010
[INFO] Final Memory: 43M/223M
[INFO] ------------------------------------------------------------------------


      

Re: Build Flex in a Headless Environment

Posted by Eric Fetzer <el...@yahoo.com>.
Martin,

I'm new to Maven / Flex, so I had to grab this from my Maven guru on the dev 
team, but here's what she said:

The maven scripts use the mxml files and all flex code to generate a build 
similar to the “Adobe Flex Builder 3” build. It generates all the files in 
the projectName-client-ria\target directory, packages them into a war file and 
then into an ear ready for deployment – running all FlexUnits along the way and 
creating the FlexUnit output reports in 
“\projectName-client-ria\target\surefire-reports”.
 
If you're interested in more info, let me know and I'll get her on here to speak 
to it better.
 
Thanks,
Eric




________________________________
From: Martin Gainty <mg...@hotmail.com>
To: users@maven.apache.org
Sent: Thu, August 19, 2010 5:14:47 PM
Subject: RE: Build Flex in a Headless Environment


Good To know!

does this plugin generate the mxml and as files and thru a module compiles those 
files with the flex compiler 

or is this just an execution only environment you're describing?



Thanks Eric,
Martin  
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.

Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.





> Date: Wed, 18 Aug 2010 19:28:06 -0700
> From: elstonkers@yahoo.com
> Subject: Re: Build Flex in a Headless Environment
> To: users@maven.apache.org
> 
> Ok, I figured it out.  Here are the steps I had to take to get this going in 
> RedHat:
> 
> 1. Install FlashPlayer10
> 2. Add FlashPLayer to your path
> 3. Install Xvfb by entering:  >up2date -i xorg-x11-Xvfb
> 4. Get xvfb-run.sh from:  
>http://www.flexthinker.com/2009/09/building-a-flex-project-with-maven-using-hudson-on-centos/xvfb-run-sh/
>/ and
> copy it to /usr/local/bin (remove the .sh extension)
> 5. chmod 755 /usr/local/bin/xvfb
> 6. Edit /etc/ld.so.conf.d/flashplayer10-i386.conf to add:
> /usr/evolution28/lib
> 7. Run >ldconfig
> 8. Add the following to your profile:
> MAVEN_OPTS="-Djava.awt.headless=true"
> 9. cd to the directory containing your pom file
> 10. >mvn install
>  
> I hope this saves someone the pain I've gone through in the past few days.
>  
> Thanks,
> Eric
>  
> 
> 
> 
> ________________________________
> From: Eric Fetzer <el...@yahoo.com>
> To: users@maven.apache.org
> Sent: Wed, August 18, 2010 7:39:16 PM
> Subject: Build Flex in a Headless Environment
> 
> Hi!  I'm very new to Maven and trying to build a flex client in a headless 
> environment.  As long as I export my display, I get no issues.  However, I need 
>
> to be able to do this headless so that it can be done in an automated fasion.  

> I'm running:
> 
> [root@newark rossPrototype-client]# mvn -version
> Apache Maven 2.2.1 (r801777; 2009-08-06 13:16:01-0600)
> Java version: 1.6.0_20
> Java home: /usr/java/jdk1.6.0_20/jre
> Default locale: en_US, platform encoding: UTF-8
> OS name: "linux" version: "2.6.9-89.el" arch: "i386" Family: "unix"
> 
> With Flex 3 and flashplayer 10.  I've tried setting MAVEN_OPTS:  
> -Djava.awt.headless=true
> I've tried adding to my pom file:
> 
> <testRunner>
>            <launcher>            
>                          <allowHeadlessMode>true</allowHeadlessMode>
>            </launcher>          
> </testRunner> 
> 
> Neither of these things changed anything.  Here is the error I'm getting 
>without 
>
> 
> my display exported based on the command >MAVEN_OPTS="-Djava.awt.headless=true" 
>
> mvn install -X:
> 
>____________________________________________________________________________________________________________
>_
> 
> 
> 
> [WARNING] [LAUNCHER] Using xvfb-run to launch headless tests
> [INFO] 
------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO] 
------------------------------------------------------------------------
> [INFO] Failed to launch Flash Player.  Probably java was not able to find 
> flashplayer.
>                Make sure flashplayer is available on PATH
>                or use -DflashPlayer.command=${flashplayer executable}
> Read more at: https://docs.sonatype.org/display/FLEXMOJOS/Running+unit+tests
> Embedded error: Failed to launch Flash Player in headless environment.
> java.io.IOException: error=2, No such file or directory
> [INFO] 
------------------------------------------------------------------------
> [DEBUG] Trace
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to launch Flash 

> Player.  Probably java was not able to find flashplayer.
>                Make sure flashplayer is available on PATH
>                or use -DflashPlayer.command=${flashplayer executable}
> Read more at: https://docs.sonatype.org/display/FLEXMOJOS/Running+unit+tests
>        at 
>org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
>)
> 
> 
>        at 
>org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
>)
> 
> 
>        at 
>org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
>)
> 
> 
>        at 
>org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
>)
> 
> 
>        at 
>org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
>)
> 
> 
>        at 
>org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
>)
> 
> 
>        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
>        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
>        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
>        at 
> org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at 
>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>)
> 
> 
>        at java.lang.reflect.Method.invoke(Method.java:597)
>        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>        at 
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to launch 
> Flash Player.  Probably java was not able to find flashplayer.
>                Make sure flashplayer is available on PATH
>                or use -DflashPlayer.command=${flashplayer executable}
> Read more at: https://docs.sonatype.org/display/FLEXMOJOS/Running+unit+tests
>        at org.sonatype.flexmojos.test.FlexUnitMojo.run(FlexUnitMojo.java:274)
>        at 
> org.sonatype.flexmojos.test.FlexUnitMojo.execute(FlexUnitMojo.java:156)
>        at 
>org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
>)
> 
> 
>        at 
>org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
>)
> 
> 
>        ... 17 more
> Caused by: org.sonatype.flexmojos.test.launcher.LaunchFlashPlayerException: 
> Failed to launch Flash Player in headless environment.
>        at 
>org.sonatype.flexmojos.test.launcher.AsVmLauncher.runFlashplayerHeadless(AsVmLauncher.java:149)
>)
> 
> 
>        at 
> org.sonatype.flexmojos.test.launcher.AsVmLauncher.start(AsVmLauncher.java:77)
>        at 
> org.sonatype.flexmojos.test.DefaultTestRunner.run(DefaultTestRunner.java:53)
>        at org.sonatype.flexmojos.test.FlexUnitMojo.run(FlexUnitMojo.java:262)
>        ... 20 more
> Caused by: java.io.IOException: Cannot run program "xvfb-run": 
> java.io.IOException: error=2, No such file or directory
>        at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
>        at java.lang.Runtime.exec(Runtime.java:593)
>        at java.lang.Runtime.exec(Runtime.java:466)
>        at 
>org.sonatype.flexmojos.test.launcher.AsVmLauncher.runFlashplayerHeadless(AsVmLauncher.java:142)
>)
> 
> 
>        ... 23 more
> Caused by: java.io.IOException: java.io.IOException: error=2, No such file or 
> directory
>        at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
>        at java.lang.ProcessImpl.start(ProcessImpl.java:65)
>        at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
>        ... 26 more
> [INFO] 
------------------------------------------------------------------------
> [INFO] Total time: 1 minute 20 seconds
> [INFO] Finished at: Wed Aug 18 19:37:03 MDT 2010
> [INFO] Final Memory: 43M/223M
> [INFO] 
------------------------------------------------------------------------
> 
> 
> 


      

RE: Build Flex in a Headless Environment

Posted by Martin Gainty <mg...@hotmail.com>.
Good To know!
 
does this plugin generate the mxml and as files and thru a module compiles those files with the flex compiler 
or is this just an execution only environment you're describing?

 

Thanks Eric,
Martin  
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.

Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.



 

> Date: Wed, 18 Aug 2010 19:28:06 -0700
> From: elstonkers@yahoo.com
> Subject: Re: Build Flex in a Headless Environment
> To: users@maven.apache.org
> 
> Ok, I figured it out.  Here are the steps I had to take to get this going in 
> RedHat:
> 
> 1. Install FlashPlayer10
> 2. Add FlashPLayer to your path
> 3. Install Xvfb by entering:  >up2date -i xorg-x11-Xvfb
> 4. Get xvfb-run.sh from:  
> http://www.flexthinker.com/2009/09/building-a-flex-project-with-maven-using-hudson-on-centos/xvfb-run-sh/ and
> copy it to /usr/local/bin (remove the .sh extension)
> 5. chmod 755 /usr/local/bin/xvfb
> 6. Edit /etc/ld.so.conf.d/flashplayer10-i386.conf to add:
> /usr/evolution28/lib
> 7. Run >ldconfig
> 8. Add the following to your profile:
> MAVEN_OPTS="-Djava.awt.headless=true"
> 9. cd to the directory containing your pom file
> 10. >mvn install
>  
> I hope this saves someone the pain I've gone through in the past few days.
>  
> Thanks,
> Eric
>  
> 
> 
> 
> ________________________________
> From: Eric Fetzer <el...@yahoo.com>
> To: users@maven.apache.org
> Sent: Wed, August 18, 2010 7:39:16 PM
> Subject: Build Flex in a Headless Environment
> 
> Hi!  I'm very new to Maven and trying to build a flex client in a headless 
> environment.  As long as I export my display, I get no issues.  However, I need 
> to be able to do this headless so that it can be done in an automated fasion.  
> I'm running:
> 
> [root@newark rossPrototype-client]# mvn -version
> Apache Maven 2.2.1 (r801777; 2009-08-06 13:16:01-0600)
> Java version: 1.6.0_20
> Java home: /usr/java/jdk1.6.0_20/jre
> Default locale: en_US, platform encoding: UTF-8
> OS name: "linux" version: "2.6.9-89.el" arch: "i386" Family: "unix"
> 
> With Flex 3 and flashplayer 10.  I've tried setting MAVEN_OPTS:  
> -Djava.awt.headless=true
> I've tried adding to my pom file:
> 
> <testRunner>
>            <launcher>            
>                           <allowHeadlessMode>true</allowHeadlessMode>
>            </launcher>           
> </testRunner> 
> 
> Neither of these things changed anything.  Here is the error I'm getting without 
> 
> my display exported based on the command >MAVEN_OPTS="-Djava.awt.headless=true" 
> mvn install -X:
> 
> ____________________________________________________________________________________________________________
> 
> 
> 
> [WARNING] [LAUNCHER] Using xvfb-run to launch headless tests
> [INFO] ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] Failed to launch Flash Player.  Probably java was not able to find 
> flashplayer.
>                 Make sure flashplayer is available on PATH
>                 or use -DflashPlayer.command=${flashplayer executable}
> Read more at: https://docs.sonatype.org/display/FLEXMOJOS/Running+unit+tests
> Embedded error: Failed to launch Flash Player in headless environment.
> java.io.IOException: error=2, No such file or directory
> [INFO] ------------------------------------------------------------------------
> [DEBUG] Trace
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to launch Flash 
> Player.  Probably java was not able to find flashplayer.
>                 Make sure flashplayer is available on PATH
>                 or use -DflashPlayer.command=${flashplayer executable}
> Read more at: https://docs.sonatype.org/display/FLEXMOJOS/Running+unit+tests
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
> 
> 
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
> 
> 
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
> 
> 
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
> 
> 
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
> 
> 
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
> 
> 
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
>         at 
> org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 
> 
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to launch 
> Flash Player.  Probably java was not able to find flashplayer.
>                 Make sure flashplayer is available on PATH
>                 or use -DflashPlayer.command=${flashplayer executable}
> Read more at: https://docs.sonatype.org/display/FLEXMOJOS/Running+unit+tests
>         at org.sonatype.flexmojos.test.FlexUnitMojo.run(FlexUnitMojo.java:274)
>         at 
> org.sonatype.flexmojos.test.FlexUnitMojo.execute(FlexUnitMojo.java:156)
>         at 
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
> 
> 
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
> 
> 
>         ... 17 more
> Caused by: org.sonatype.flexmojos.test.launcher.LaunchFlashPlayerException: 
> Failed to launch Flash Player in headless environment.
>         at 
> org.sonatype.flexmojos.test.launcher.AsVmLauncher.runFlashplayerHeadless(AsVmLauncher.java:149)
> 
> 
>         at 
> org.sonatype.flexmojos.test.launcher.AsVmLauncher.start(AsVmLauncher.java:77)
>         at 
> org.sonatype.flexmojos.test.DefaultTestRunner.run(DefaultTestRunner.java:53)
>         at org.sonatype.flexmojos.test.FlexUnitMojo.run(FlexUnitMojo.java:262)
>         ... 20 more
> Caused by: java.io.IOException: Cannot run program "xvfb-run": 
> java.io.IOException: error=2, No such file or directory
>         at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
>         at java.lang.Runtime.exec(Runtime.java:593)
>         at java.lang.Runtime.exec(Runtime.java:466)
>         at 
> org.sonatype.flexmojos.test.launcher.AsVmLauncher.runFlashplayerHeadless(AsVmLauncher.java:142)
> 
> 
>         ... 23 more
> Caused by: java.io.IOException: java.io.IOException: error=2, No such file or 
> directory
>         at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
>         at java.lang.ProcessImpl.start(ProcessImpl.java:65)
>         at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
>         ... 26 more
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 1 minute 20 seconds
> [INFO] Finished at: Wed Aug 18 19:37:03 MDT 2010
> [INFO] Final Memory: 43M/223M
> [INFO] ------------------------------------------------------------------------
> 
> 
> 
 		 	   		  

Re: Build Flex in a Headless Environment

Posted by Marvin Froeder <ve...@gmail.com>.
It would be really nice if you share your tips with other users by add this
info on flexmojos wiki
https://docs.sonatype.org/display/FLEXMOJOS/Running+unit+tests#Runningunittests-linux

It is public editable.


VELO

On Wed, Aug 18, 2010 at 11:28 PM, Eric Fetzer <el...@yahoo.com> wrote:

> Ok, I figured it out.  Here are the steps I had to take to get this going
> in
> RedHat:
>
>        1. Install FlashPlayer10
>        2. Add FlashPLayer to your path
>        3. Install Xvfb by entering:  >up2date -i xorg-x11-Xvfb
>        4. Get xvfb-run.sh from:
>
> http://www.flexthinker.com/2009/09/building-a-flex-project-with-maven-using-hudson-on-centos/xvfb-run-sh/
>  and
>  copy it to /usr/local/bin (remove the .sh extension)
>        5. chmod 755 /usr/local/bin/xvfb
>        6. Edit /etc/ld.so.conf.d/flashplayer10-i386.conf to add:
> /usr/evolution28/lib
>        7. Run >ldconfig
>        8. Add the following to your profile:
> MAVEN_OPTS="-Djava.awt.headless=true"
>         9. cd to the directory containing your pom file
>        10. >mvn install
>
> I hope this saves someone the pain I've gone through in the past few days.
>
> Thanks,
> Eric
>
>
>
>
> ________________________________
> From: Eric Fetzer <el...@yahoo.com>
> To: users@maven.apache.org
> Sent: Wed, August 18, 2010 7:39:16 PM
> Subject: Build Flex in a Headless Environment
>
> Hi!  I'm very new to Maven and trying to build a flex client in a headless
> environment.  As long as I export my display, I get no issues.  However, I
> need
> to be able to do this headless so that it can be done in an automated
> fasion.
> I'm running:
>
> [root@newark rossPrototype-client]# mvn -version
> Apache Maven 2.2.1 (r801777; 2009-08-06 13:16:01-0600)
> Java version: 1.6.0_20
> Java home: /usr/java/jdk1.6.0_20/jre
> Default locale: en_US, platform encoding: UTF-8
> OS name: "linux" version: "2.6.9-89.el" arch: "i386" Family: "unix"
>
> With Flex 3 and flashplayer 10.  I've tried setting MAVEN_OPTS:
> -Djava.awt.headless=true
> I've tried adding to my pom file:
>
> <testRunner>
>            <launcher>
>                           <allowHeadlessMode>true</allowHeadlessMode>
>            </launcher>
> </testRunner>
>
> Neither of these things changed anything.  Here is the error I'm getting
> without
>
> my display exported based on the command
> >MAVEN_OPTS="-Djava.awt.headless=true"
> mvn install -X:
>
>
> ____________________________________________________________________________________________________________
>
>
>
> [WARNING] [LAUNCHER] Using xvfb-run to launch headless tests
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Failed to launch Flash Player.  Probably java was not able to find
> flashplayer.
>                 Make sure flashplayer is available on PATH
>                 or use -DflashPlayer.command=${flashplayer executable}
> Read more at:
> https://docs.sonatype.org/display/FLEXMOJOS/Running+unit+tests
> Embedded error: Failed to launch Flash Player in headless environment.
> java.io.IOException: error=2, No such file or directory
> [INFO]
> ------------------------------------------------------------------------
> [DEBUG] Trace
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to launch
> Flash
> Player.  Probably java was not able to find flashplayer.
>                 Make sure flashplayer is available on PATH
>                 or use -DflashPlayer.command=${flashplayer executable}
> Read more at:
> https://docs.sonatype.org/display/FLEXMOJOS/Running+unit+tests
>         at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
>
>
>         at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
>
>
>         at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
>
>
>         at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
>
>
>         at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
>
>
>         at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
>
>
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
>         at
> org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
>
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at
> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to launch
> Flash Player.  Probably java was not able to find flashplayer.
>                 Make sure flashplayer is available on PATH
>                 or use -DflashPlayer.command=${flashplayer executable}
> Read more at:
> https://docs.sonatype.org/display/FLEXMOJOS/Running+unit+tests
>         at
> org.sonatype.flexmojos.test.FlexUnitMojo.run(FlexUnitMojo.java:274)
>         at
> org.sonatype.flexmojos.test.FlexUnitMojo.execute(FlexUnitMojo.java:156)
>         at
>
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
>
>
>         at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
>
>
>         ... 17 more
> Caused by: org.sonatype.flexmojos.test.launcher.LaunchFlashPlayerException:
> Failed to launch Flash Player in headless environment.
>         at
>
> org.sonatype.flexmojos.test.launcher.AsVmLauncher.runFlashplayerHeadless(AsVmLauncher.java:149)
>
>
>         at
>
> org.sonatype.flexmojos.test.launcher.AsVmLauncher.start(AsVmLauncher.java:77)
>         at
>
> org.sonatype.flexmojos.test.DefaultTestRunner.run(DefaultTestRunner.java:53)
>         at
> org.sonatype.flexmojos.test.FlexUnitMojo.run(FlexUnitMojo.java:262)
>         ... 20 more
> Caused by: java.io.IOException: Cannot run program "xvfb-run":
> java.io.IOException: error=2, No such file or directory
>         at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
>         at java.lang.Runtime.exec(Runtime.java:593)
>         at java.lang.Runtime.exec(Runtime.java:466)
>         at
>
> org.sonatype.flexmojos.test.launcher.AsVmLauncher.runFlashplayerHeadless(AsVmLauncher.java:142)
>
>
>         ... 23 more
> Caused by: java.io.IOException: java.io.IOException: error=2, No such file
> or
> directory
>         at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
>         at java.lang.ProcessImpl.start(ProcessImpl.java:65)
>         at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
>         ... 26 more
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 1 minute 20 seconds
> [INFO] Finished at: Wed Aug 18 19:37:03 MDT 2010
> [INFO] Final Memory: 43M/223M
> [INFO]
> ------------------------------------------------------------------------
>
>
>
>

Re: Build Flex in a Headless Environment

Posted by Eric Fetzer <el...@yahoo.com>.
Ok, I figured it out.  Here are the steps I had to take to get this going in 
RedHat:

	1. Install FlashPlayer10
	2. Add FlashPLayer to your path
	3. Install Xvfb by entering:  >up2date -i xorg-x11-Xvfb
	4. Get xvfb-run.sh from:  
http://www.flexthinker.com/2009/09/building-a-flex-project-with-maven-using-hudson-on-centos/xvfb-run-sh/ and
 copy it to /usr/local/bin (remove the .sh extension)
	5. chmod 755 /usr/local/bin/xvfb
	6. Edit /etc/ld.so.conf.d/flashplayer10-i386.conf to add:
/usr/evolution28/lib
	7. Run >ldconfig
	8. Add the following to your profile:
MAVEN_OPTS="-Djava.awt.headless=true"
	9. cd to the directory containing your pom file
	10. >mvn install
 
I hope this saves someone the pain I've gone through in the past few days.
 
Thanks,
Eric
 



________________________________
From: Eric Fetzer <el...@yahoo.com>
To: users@maven.apache.org
Sent: Wed, August 18, 2010 7:39:16 PM
Subject: Build Flex in a Headless Environment

Hi!  I'm very new to Maven and trying to build a flex client in a headless 
environment.  As long as I export my display, I get no issues.  However, I need 
to be able to do this headless so that it can be done in an automated fasion.  
I'm running:

[root@newark rossPrototype-client]# mvn -version
Apache Maven 2.2.1 (r801777; 2009-08-06 13:16:01-0600)
Java version: 1.6.0_20
Java home: /usr/java/jdk1.6.0_20/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.9-89.el" arch: "i386" Family: "unix"

With Flex 3 and flashplayer 10.  I've tried setting MAVEN_OPTS:  
-Djava.awt.headless=true
I've tried adding to my pom file:

<testRunner>
           <launcher>            
                          <allowHeadlessMode>true</allowHeadlessMode>
           </launcher>           
</testRunner> 

Neither of these things changed anything.  Here is the error I'm getting without 

my display exported based on the command >MAVEN_OPTS="-Djava.awt.headless=true" 
mvn install -X:

____________________________________________________________________________________________________________



[WARNING] [LAUNCHER] Using xvfb-run to launch headless tests
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to launch Flash Player.  Probably java was not able to find 
flashplayer.
                Make sure flashplayer is available on PATH
                or use -DflashPlayer.command=${flashplayer executable}
Read more at: https://docs.sonatype.org/display/FLEXMOJOS/Running+unit+tests
Embedded error: Failed to launch Flash Player in headless environment.
java.io.IOException: error=2, No such file or directory
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to launch Flash 
Player.  Probably java was not able to find flashplayer.
                Make sure flashplayer is available on PATH
                or use -DflashPlayer.command=${flashplayer executable}
Read more at: https://docs.sonatype.org/display/FLEXMOJOS/Running+unit+tests
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)


        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)


        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)


        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)


        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)


        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)


        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at 
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)


        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to launch 
Flash Player.  Probably java was not able to find flashplayer.
                Make sure flashplayer is available on PATH
                or use -DflashPlayer.command=${flashplayer executable}
Read more at: https://docs.sonatype.org/display/FLEXMOJOS/Running+unit+tests
        at org.sonatype.flexmojos.test.FlexUnitMojo.run(FlexUnitMojo.java:274)
        at 
org.sonatype.flexmojos.test.FlexUnitMojo.execute(FlexUnitMojo.java:156)
        at 
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)


        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)


        ... 17 more
Caused by: org.sonatype.flexmojos.test.launcher.LaunchFlashPlayerException: 
Failed to launch Flash Player in headless environment.
        at 
org.sonatype.flexmojos.test.launcher.AsVmLauncher.runFlashplayerHeadless(AsVmLauncher.java:149)


        at 
org.sonatype.flexmojos.test.launcher.AsVmLauncher.start(AsVmLauncher.java:77)
        at 
org.sonatype.flexmojos.test.DefaultTestRunner.run(DefaultTestRunner.java:53)
        at org.sonatype.flexmojos.test.FlexUnitMojo.run(FlexUnitMojo.java:262)
        ... 20 more
Caused by: java.io.IOException: Cannot run program "xvfb-run": 
java.io.IOException: error=2, No such file or directory
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
        at java.lang.Runtime.exec(Runtime.java:593)
        at java.lang.Runtime.exec(Runtime.java:466)
        at 
org.sonatype.flexmojos.test.launcher.AsVmLauncher.runFlashplayerHeadless(AsVmLauncher.java:142)


        ... 23 more
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or 
directory
        at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
        at java.lang.ProcessImpl.start(ProcessImpl.java:65)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
        ... 26 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 minute 20 seconds
[INFO] Finished at: Wed Aug 18 19:37:03 MDT 2010
[INFO] Final Memory: 43M/223M
[INFO] ------------------------------------------------------------------------