Search code examples
javamavenjbosswildfly

Exception when starting maven wildfly plugin: server failed to start within 60 seconds


I had a project cloned from bit-bucket, when I loaded it on my system. maven downloaded all it's dependencies, but apparently when it's time for the maven wildfly plugin server to start and run the integrated test, I get an error. maven wildfly plugin unable to start within 60 seconds. my boss stated earlier that it was my PC was running on a 2gb ram, which I had to upgrade to a 4gb ram, but when I try to start the server, I still get the same error.

I have attached my stacktrace, if anyone could be able to help with me a work around concerning making the server start within the specified time. thank you.

Caused by: java.util.concurrent.TimeoutException: The server did not start within 60 seconds.
at org.wildfly.plugin.core.ServerHelper.waitForStandalone (ServerHelper.java:318)
at org.wildfly.plugin.server.StartMojo.execute (StartMojo.java:290)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:564)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[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
 'cmd' is not recognized as an internal or external command,

operable program or batch file.


Solution

  • You can set an property in your pom.xml to increase the timeout time: https://docs.jboss.org/wildfly/plugins/maven/latest/deploy-mojo.html#timeout

    should look something like this:

            <plugin>
                <groupId>org.wildfly.plugins</groupId>
                <artifactId>wildfly-maven-plugin</artifactId>
                <version>2.0.0.Final</version>
                <configuration>
                   <timeout>300</timeout>
                </configuration>
            </plugin>
    

    You could also set it as an property in you pom.xml

    <properties>
      <wildfly.timeout>300</wildfly.timeout>
    </properties>
    

    If you want to increase the timeout treshold to 300 seconds