We're updating the issue view to help you get more done. 

Cannot use Tomcat NIO connector with Cargo

Description

If you set-up Cargo to use Tomcat and provide your own server.xml, then you get a stack trace:

This is the NIO connector:

1 <Connector connectionTimeout="20000" port="8080" protocol="org.apache.coyote.http11.Http11NioProtocol" redirectPort="8443" />

Copied into the set-up using this XML:

1 2 3 4 5 6 7 8 <files> <copy> <!-- copy in our a server.xml file (originally taken from executing "mvn cargo:run") with added resource into Tomcat's conf dir --> <file>src/test/conf/server.xml</file> <todir>conf</todir> </copy> </files>

This is the stack trace:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 [ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.2.2:run (default-cli) on project websocket: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.2.2:run failed: Cannot modify XML file /Users/alexec/Documents/workspace/websocket/target/cargo/configurations/tomcat6x/conf/server.xml: Node //Server/Service/Connector[not(@protocol) or @protocol='HTTP/1.1'] not found in file /Users/alexec/Documents/workspace/websocket/target/cargo/configurations/tomcat6x/conf/server.xml -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.2.2:run (default-cli) on project websocket: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.2.2:run failed: Cannot modify XML file /Users/alexec/Documents/workspace/websocket/target/cargo/configurations/tomcat6x/conf/server.xml 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: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:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) 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 default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.2.2:run failed: Cannot modify XML file /Users/alexec/Documents/workspace/websocket/target/cargo/configurations/tomcat6x/conf/server.xml 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.util.CargoException: Cannot modify XML file /Users/alexec/Documents/workspace/websocket/target/cargo/configurations/tomcat6x/conf/server.xml at org.codehaus.cargo.util.DefaultFileHandler.replaceInXmlFile(DefaultFileHandler.java:496) at org.codehaus.cargo.container.spi.configuration.AbstractStandaloneLocalConfiguration.performXmlReplacements(AbstractStandaloneLocalConfiguration.java:128) at org.codehaus.cargo.container.tomcat.Tomcat5xStandaloneLocalConfiguration.performXmlReplacements(Tomcat5xStandaloneLocalConfiguration.java:155) at org.codehaus.cargo.container.spi.configuration.AbstractStandaloneLocalConfiguration.configure(AbstractStandaloneLocalConfiguration.java:91) at org.codehaus.cargo.container.spi.configuration.builder.AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder.configure(AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder.java:123) at org.codehaus.cargo.container.spi.AbstractLocalContainer.start(AbstractLocalContainer.java:159) at org.codehaus.cargo.maven2.AbstractContainerStartMojo.doExecute(AbstractContainerStartMojo.java:61) at org.codehaus.cargo.maven2.ContainerRunMojo.doExecute(ContainerRunMojo.java:60) at org.codehaus.cargo.maven2.AbstractCargoMojo.execute(AbstractCargoMojo.java:322) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) ... 20 more Caused by: org.codehaus.cargo.util.CargoException: Node //Server/Service/Connector[not(@protocol) or @protocol='HTTP/1.1'] not found in file /Users/alexec/Documents/workspace/websocket/target/cargo/configurations/tomcat6x/conf/server.xml at org.codehaus.cargo.util.DefaultFileHandler.replaceInXmlFile(DefaultFileHandler.java:467) ... 29 more

Status

Assignee

Savas Ali Tokmen

Reporter

Alex Collins

Components

Fix versions

Affects versions

1.2.2

Priority

Minor