[ 
https://jira.codehaus.org/browse/SUREFIRE-843?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=293730#comment-293730
 ] 

Niraj Tolia commented on SUREFIRE-843:
--------------------------------------

Sneha: Try these steps to narrow down your problem:

1. Configure surefire to fork unit tests and then run mvn -X test.
2. Grab the surefire startup line from the debug output (should start with 
/bin/bash).
3. Execute that command directly and when it fails, run 'echo $?' to get the 
status.
4. Then grep all your code or any external code that might be calling 
System.exit() with that status.
                
> Unable to run 'mvn test' with Java 7
> ------------------------------------
>
>                 Key: SUREFIRE-843
>                 URL: https://jira.codehaus.org/browse/SUREFIRE-843
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Maven Surefire Plugin
>    Affects Versions: 2.12
>         Environment: Mac OS X
> java version "1.7.0_04-ea"
> Java(TM) SE Runtime Environment (build 1.7.0_04-ea-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 23.0-b15, mixed mode)
>            Reporter: Niraj Tolia
>
> I am trying to run mvn test and it always fails at some arbitrary time with 
> the message 'Error occurred in starting fork'. See the output below. Note 
> that it does not execute all tests but fails in between the test run. The 
> number of tests surefire finishes executing is random but it has never 
> completed the entire test run. I am using Java7u4 Build b13 with Maven 3.0.3 
> and surefire v2.12.
> Any clue what might be going wrong? This is a blocker for me.
> {noformat}
> Results :
> Tests run: 230, Failures: 0, Errors: 0, Skipped: 0
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Total time: 41.204s
> [INFO] Finished at: Thu Feb 23 17:40:55 PST 2012
> [INFO] Final Memory: 17M/212M
> [INFO] 
> ------------------------------------------------------------------------
> [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on 
> project test-project: Error occurred in starting fork, check output in log -> 
> [Help 1]
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute 
> goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) 
> on project test-project: Error occurred in starting fork, check output in log
>       at 
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
>       at 
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
>       at 
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
>       at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
>       at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
>       at 
> org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
>       at 
> org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
>       at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
>       at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
>       at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
>       at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
>       at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:601)
>       at 
> org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
>       at 
> org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
>       at 
> org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
>       at 
> org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
> Caused by: org.apache.maven.plugin.MojoExecutionException: Error occurred in 
> starting fork, check output in log
>       at 
> org.apache.maven.plugin.surefire.SurefirePlugin.assertNoException(SurefirePlugin.java:656)
>       at 
> org.apache.maven.plugin.surefire.SurefirePlugin.handleSummary(SurefirePlugin.java:645)
>       at 
> org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:137)
>       at 
> org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:98)
>       at 
> org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
>       at 
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
>       ... 19 more
> Caused by: org.apache.maven.surefire.booter.SurefireBooterForkException: 
> Error occurred in starting fork, check output in log
>       at 
> org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:281)
>       at 
> org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:113)
>       at 
> org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:199)
>       at 
> org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAllProviders(AbstractSurefireMojo.java:176)
>       at 
> org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:135)
>       ... 22 more
> [ERROR] 
> [ERROR] 
> [ERROR] For more information about the errors and possible solutions, please 
> read the following articles:
> [ERROR] [Help 1] 
> http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
> {noformat}
> This occurs with a very simple surefire plugin config:
> {noformat}
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-surefire-plugin</artifactId>
>         <version>${surefire.version}</version>
>         <configuration>
>           <parallel>classes</parallel>
>         </configuration>
>       </plugin>
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to