When I am working with Maven and Flex with FlexMojos I come across the below error.
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building firstApp Flex
[INFO] task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO] [flexmojos:compile-swf {execution: default-compile-swf}]
[INFO] Flexmojos 3.7
[INFO] Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file
[WARNING] Source file was not defined, flexmojos will guess one.
[INFO] Flex compiler configurations:
-compiler.accessible=false
-compiler.actionscript-file-encoding UTF-8
-compiler.allow-source-path-overlap=false
-compiler.as3=true
-compiler.debug=false
-compiler.es=false
-compiler.external-library-path E:\raghava\firstApp\target\classes\libraries\pla
yerglobal-9.swc
-compiler.fonts.local-fonts-snapshot E:\raghava\firstApp\target\classes\fonts.se
r
-compiler.fonts.managers flash.fonts.JREFontManager flash.fonts.AFEFontManager f
lash.fonts.BatikFontManager
-compiler.headless-server=false
-compiler.include-libraries=
-compiler.keep-all-type-selectors=false
-compiler.keep-generated-actionscript=false
-compiler.library-path E:\raghava\firstApp\target\classes\libraries\flex.swc E:\
raghava\firstApp\target\classes\libraries\framework.swc E:\raghava\firstApp\targ
et\classes\libraries\rpc.swc E:\raghava\firstApp\target\classes\libraries\utilit
ies.swc D:\Documents and Settings\Jagadesh\.m2\repository\com\adobe\flex\framewo
rk\framework\3.2.0.3958\framework-3.2.0.3958-en_US.rb.swc D:\Documents and Setti
ngs\Jagadesh\.m2\repository\com\adobe\flex\framework\rpc\3.2.0.3958\rpc-3.2.0.39
58-en_US.rb.swc
-compiler.locale en_US
-compiler.namespaces.namespace http://www.adobe.com/2006/mxml E:\raghava\firstAp
p\target\classes\config-3.2.0.3958\mxml-manifest.xml
-compiler.optimize=true
-compiler.source-path E:\raghava\firstApp\src\main\flex
-compiler.strict=true
-compiler.use-resource-bundle-metadata=true
-compiler.verbose-stacktraces=false
-default-background-color 8821927
-default-frame-rate 24
-default-script-limits 1000 60
-default-size 500 375
-metadata.date Sat Oct 09 09:40:02 PDT 2010
-metadata.localized-title firstApp Flex x-default
-target-player 9.0.0
-use-network=true
-verify-digests=true -static-link-runtime-shared-libraries=false -load-config=
-metadata.language+=en_US
[INFO] [resources:testResources {execution: default-testResources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory E:\raghava\firstApp\src\test\resource
s
[INFO] [flexmojos:test-compile {execution: default-test-compile}]
[INFO] Flexmojos 3.7
[INFO] Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file
[WARNING] Test folder not foundE:\raghava\firstApp\src\test\java
[INFO] [flexmojos:test-run {execution: default-test-run}]
[INFO] Flexmojos 3.7
[INFO] Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file
[INFO] Running tests E:\raghava\firstApp\target\test-classes\TestRunner.swf
[WARNING] [LAUNCHER] Using regular flashplayer tests
[INFO] ------------------------------------------------------------------------
[INFO] Tests run: 0, Failures: 0, Errors: 0, Time Elapsed: 0 sec
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Accept timed outE:\raghava\firstApp\target\test-classes\TestRunner.swf
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Accept timed outE:\ragha
va\firstApp\target\test-classes\TestRunner.swf
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:719)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.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:6
0)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
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: Accept timed outE:\ra
ghava\firstApp\target\test-classes\TestRunner.swf
at org.sonatype.flexmojos.test.FlexUnitMojo.tearDown(FlexUnitMojo.java:3
15)
at org.sonatype.flexmojos.test.FlexUnitMojo.execute(FlexUnitMojo.java:16
5)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:694)
... 17 more
Caused by: org.sonatype.flexmojos.test.TestRunnerException: Accept timed outE:\r
aghava\firstApp\target\test-classes\TestRunner.swf
at org.sonatype.flexmojos.test.DefaultTestRunner.run(DefaultTestRunner.j
ava:87)
at org.sonatype.flexmojos.test.FlexUnitMojo.run(FlexUnitMojo.java:279)
at org.sonatype.flexmojos.test.FlexUnitMojo.execute(FlexUnitMojo.java:16
4)
... 19 more
Caused by: java.net.SocketTimeoutException: Accept timed out
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
at java.net.ServerSocket.implAccept(ServerSocket.java:450)
at java.net.ServerSocket.accept(ServerSocket.java:421)
at org.sonatype.flexmojos.test.monitor.AbstractSocketThread.openClientSo
cket(AbstractSocketThread.java:124)
at org.sonatype.flexmojos.test.monitor.AbstractSocketThread.run(Abstract
SocketThread.java:62)
at java.lang.Thread.run(Thread.java:595)
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 53 seconds
[INFO] Finished at: Sat Oct 09 09:40:27 PDT 2010
[INFO] Final Memory: 20M/63M
[INFO] ------------------------------------------------------------------------
E:\raghava\firstApp>mvn -e install
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building firstApp Flex
[INFO] task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO] [flexmojos:compile-swf {execution: default-compile-swf}]
[INFO] Flexmojos 3.7
[INFO] Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file
[WARNING] Source file was not defined, flexmojos will guess one.
[INFO] Flex compiler configurations:
-compiler.accessible=false
-compiler.actionscript-file-encoding UTF-8
-compiler.allow-source-path-overlap=false
-compiler.as3=true
-compiler.debug=false
-compiler.es=false
-compiler.external-library-path E:\raghava\firstApp\target\classes\libraries\pla
yerglobal-9.swc
-compiler.fonts.local-fonts-snapshot E:\raghava\firstApp\target\classes\fonts.se
r
-compiler.fonts.managers flash.fonts.JREFontManager flash.fonts.AFEFontManager f
lash.fonts.BatikFontManager
-compiler.headless-server=false
-compiler.include-libraries=
-compiler.keep-all-type-selectors=false
-compiler.keep-generated-actionscript=false
-compiler.library-path E:\raghava\firstApp\target\classes\libraries\flex.swc E:\
raghava\firstApp\target\classes\libraries\framework.swc E:\raghava\firstApp\targ
et\classes\libraries\rpc.swc E:\raghava\firstApp\target\classes\libraries\utilit
ies.swc D:\Documents and Settings\Jagadesh\.m2\repository\com\adobe\flex\framewo
rk\framework\3.2.0.3958\framework-3.2.0.3958-en_US.rb.swc D:\Documents and Setti
ngs\Jagadesh\.m2\repository\com\adobe\flex\framework\rpc\3.2.0.3958\rpc-3.2.0.39
58-en_US.rb.swc
-compiler.locale en_US
-compiler.namespaces.namespace http://www.adobe.com/2006/mxml E:\raghava\firstAp
p\target\classes\config-3.2.0.3958\mxml-manifest.xml
-compiler.optimize=true
-compiler.source-path E:\raghava\firstApp\src\main\flex
-compiler.strict=true
-compiler.use-resource-bundle-metadata=true
-compiler.verbose-stacktraces=false
-default-background-color 8821927
-default-frame-rate 24
-default-script-limits 1000 60
-default-size 500 375
-metadata.date Sat Oct 09 09:50:02 PDT 2010
-metadata.localized-title firstApp Flex x-default
-target-player 9.0.0
-use-network=true
-verify-digests=true -static-link-runtime-shared-libraries=false -load-config=
-metadata.language+=en_US
[INFO] [resources:testResources {execution: default-testResources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory E:\raghava\firstApp\src\test\resource
s
[INFO] [flexmojos:test-compile {execution: default-test-compile}]
[INFO] Flexmojos 3.7
[INFO] Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file
[WARNING] Test folder not foundE:\raghava\firstApp\src\test\java
[INFO] [flexmojos:test-run {execution: default-test-run}]
[INFO] Flexmojos 3.7
[INFO] Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file
[INFO] Running tests E:\raghava\firstApp\target\test-classes\TestRunner.swf
[WARNING] [LAUNCHER] Using regular flashplayer tests
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to launch Flash Player. Probably java was not able to find flashp
layer.
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
CreateProcess: FlashPlayer.exe E:\raghava\firstApp\target\test-classes\TestRunne
r.swf error=2
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to launch Flash P
layer. 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(Defa
ultLifecycleExecutor.java:719)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.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:6
0)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
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 Flas
h 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:291)
at org.sonatype.flexmojos.test.FlexUnitMojo.execute(FlexUnitMojo.java:16
4)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:694)
... 17 more
Caused by: org.sonatype.flexmojos.test.launcher.LaunchFlashPlayerException: Fail
ed to launch Flash Player.
at org.sonatype.flexmojos.test.launcher.AsVmLauncher.runFlashplayer(AsVm
Launcher.java:126)
at org.sonatype.flexmojos.test.launcher.AsVmLauncher.start(AsVmLauncher.
java:102)
at org.sonatype.flexmojos.test.DefaultTestRunner.run(DefaultTestRunner.j
ava:75)
at org.sonatype.flexmojos.test.FlexUnitMojo.run(FlexUnitMojo.java:279)
... 20 more
Caused by: java.io.IOException: CreateProcess: FlashPlayer.exe E:\raghava\firstA
pp\target\test-classes\TestRunner.swf error=2
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.(ProcessImpl.java:81)
at java.lang.ProcessImpl.start(ProcessImpl.java:30)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
at java.lang.Runtime.exec(Runtime.java:591)
at java.lang.Runtime.exec(Runtime.java:464)
at org.sonatype.flexmojos.test.launcher.AsVmLauncher.runFlashplayer(AsVm
Launcher.java:122)
... 23 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 35 seconds
[INFO] Finished at: Sat Oct 09 09:50:08 PDT 2010
[INFO] Final Memory: 20M/63M
[INFO] ------------------------------------------------------------------------
As per the life cycle mojos trying to run unit test and unable to find flashplayer. To resolve this I have downloaded flashplayer exe file added to PATH. Again I got the same problem. Now I renamed the download flashplayer name to flashplayer.exe, my build completed successfully.