cargo-maven2-plugin not terminating correctly after stopping Jetty on Windows

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

cargo-maven2-plugin not terminating correctly after stopping Jetty on Windows

Jeff Stairs
This post has NOT been accepted by the mailing list yet.
Hi,

I am using the cargo maven2 plugin extensively to deploy several jetty 9.0.x applications.   I'm currently using version 1.3.1 to
deploy applications using bamboo on Linux.  Everything is fine and working well.

I've just had a request to set up some deployments on Windows.  While doing this I thought that I would start using the latest
version of the plugin.  However I've noticed that all versions of the plugin, up to 1.4.10, start the application correctly,
but 1.4.4 is the latest version that can reliably stop the application on Windows.

Starting, regardless of cargo version,  always results in two java.exe processes (which is correct).
I can see that the jettty web app is listening on the application port, as well as the stop port.  

1.4.10 will sometimes stop the application correctly, without error, but other times it fails.

I've attached a log which shows the failure

Is this a problem that anyone has seen before and could advise on?   Any advice is welcome.

Kind Regards


mvn -e install -Dcargo.plugin.version=1.4.10 -Pdeploy-stopJetty  -Ddeploy.stopTimeout=120 -Ddeploy.pingPort=10000 -Ddeploy.jettyVersion=jetty9x -Ddeploy.jettyHome=c:/opt/apps/Test
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building deploytest-deploy-windows 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.0.1:enforce (enforce-versions) @ deploytest-deploy-windows ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.0.1:enforce (enforce-deployment-variables) @ deploytest-deploy-windows ---
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ deploytest-deploy-windows ---
[INFO] Installing C:\Users\build-eng\workspaces\jetty-deployer\jetty\branches\deploytest-deploy-windows\pom.xml to C:\Users\build-eng
\.m2\repository\com\sample\deploytest-deploy-windows\0.0.1-SNAPSHOT\deploytest-deploy-windows-0.0.1-SNAPSHOT.pom
[INFO]
[INFO] --- cargo-maven2-plugin:1.4.10:stop (stop-webapp) @ deploytest-deploy-windows ---
[INFO] [n2.ContainerStopMojo] Resolved container artifact org.codehaus.cargo:cargo-core-container-jetty:jar:1.4.10 for cont
ainer jetty9x
[INFO] [talledLocalContainer] Jetty 9.0.7.v20131107 is stopping...
[INFO] [talledLocalContainer] Waiting 120 seconds for jetty to stop
[INFO] [talledLocalContainer] java.net.SocketException: Connection reset
[INFO] [talledLocalContainer]   at java.net.SocketInputStream.read(SocketInputStream.java:196)
[INFO] [talledLocalContainer]   at java.net.SocketInputStream.read(SocketInputStream.java:122)
[INFO] [talledLocalContainer]   at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283)
[INFO] [talledLocalContainer]   at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325)
[INFO] [talledLocalContainer]   at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)
[INFO] [talledLocalContainer]   at java.io.InputStreamReader.read(InputStreamReader.java:184)
[INFO] [talledLocalContainer]   at java.io.BufferedReader.fill(BufferedReader.java:154)
[INFO] [talledLocalContainer]   at java.io.BufferedReader.readLine(BufferedReader.java:317)
[INFO] [talledLocalContainer]   at java.io.LineNumberReader.readLine(LineNumberReader.java:199)
[INFO] [talledLocalContainer]   at org.eclipse.jetty.start.Main.stop(Main.java:1103)
[INFO] [talledLocalContainer]   at org.eclipse.jetty.start.Main.processCommandLine(Main.java:178)
[INFO] [talledLocalContainer]   at org.eclipse.jetty.start.Main.main(Main.java:97)
[INFO] [talledLocalContainer]
[INFO] [talledLocalContainer] Usage: java -jar start.jar [options] [properties] [configs]
[INFO] [talledLocalContainer]        java -jar start.jar --help  # for more information
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.286s
[INFO] Finished at: Thu Oct 02 10:21:54 CEST 2014
[INFO] Final Memory: 5M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.10:stop (stop-webapp) on project deploytest-deplo
y-windows: Execution stop-webapp of goal org.codehaus.cargo:cargo-maven2-plugin:1.4.10:stop failed: Failed to stop the Jett
y 9.0.7.v20131107 container. Jetty command failed: exit code was -5 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.1
0:stop (stop-webapp) on project deploytest-deploy-windows: Execution stop-webapp of goal org.codehaus.cargo:cargo-maven2-pl
ugin:1.4.10:stop failed: Failed to stop the Jetty 9.0.7.v20131107 container.
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
        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:320)
        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:606)
        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.PluginExecutionException: Execution stop-webapp of goal org.codehaus.cargo:cargo-maven2-
plugin:1.4.10:stop failed: Failed to stop the Jetty 9.0.7.v20131107 container.
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        ... 19 more
Caused by: org.codehaus.cargo.container.ContainerException: Failed to stop the Jetty 9.0.7.v20131107 container.
        at org.codehaus.cargo.container.spi.AbstractLocalContainer.stop(AbstractLocalContainer.java:304)
        at org.codehaus.cargo.maven2.ContainerStopMojo.doExecute(ContainerStopMojo.java:49)
        at org.codehaus.cargo.maven2.AbstractCargoMojo.execute(AbstractCargoMojo.java:432)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
        ... 20 more
Caused by: org.codehaus.cargo.util.CargoException: Jetty command failed: exit code was -5
        at org.codehaus.cargo.container.jetty.Jetty6xInstalledLocalContainer.invoke(Jetty6xInstalledLocalContainer.java:232
)
        at org.codehaus.cargo.container.jetty.Jetty7xInstalledLocalContainer.invoke(Jetty7xInstalledLocalContainer.java:89)

        at org.codehaus.cargo.container.jetty.Jetty6xInstalledLocalContainer.doStop(Jetty6xInstalledLocalContainer.java:150
)
        at org.codehaus.cargo.container.spi.AbstractInstalledLocalContainer.stopInternal(AbstractInstalledLocalContainer.ja
va:303)
        at org.codehaus.cargo.container.spi.AbstractLocalContainer.stop(AbstractLocalContainer.java:283)
        ... 23 more
[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/PluginExecutionException