Cargo remote deployment Tomcat7: Error writing request body to server

I tried to deploy a WAR into a TomEE/Tomcat7 application server and I received an exception: „Error writing request body to server„. No Tomcat log file has useful information about that.

I use maven with Cargo plugin to deploy via the manager application of the Tomcat.

The configuration of the plugin inside the pom.xml is:

<plugin><!-- http://stackoverflow.com/questions/6436351/cannot-redeploy-to-remote-tomcat-7-with-using-cargo-maven-plugin, http://cargo.codehaus.org/Deploying+to+a+running+container -->
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.4.2</version>
<configuration>
<path>${remote.deployment.path}/${project.artifactId}/DEPLOY    /${project.artifactId}-DEPLOY.war</path>
<skip>${xxxx.deployment.skip}</skip>
<container>
<containerId>tomcat7x</containerId>
<type>remote</type>
</container>
<configuration>
<type>runtime</type>
<properties>
<cargo.remote.username>${xxxx.user}</cargo.remote.username>
<cargo.remote.password>${xxxx.pwd}</cargo.remote.password>
<cargo.remote.uri>http://${xxxx.host}:8080/manager/text</cargo.remote.uri>
</properties>
</configuration>
</configuration>
</plugin>

The command line is: mvn -X cargo:deployer-redeploy -P testsystem

In the internet I found two hints to solve the problem. First I checked the amount of bytes to send to the management application. There were some restrictions in the webapps/manager/WEB-INF/web.xml file at multipart-config>max-***-size.

Unfortunately this wasn’t my problem. The second hint were the proxy settings. I disabled my Ubuntu network proxy. But I forgot the ~/.m2/settings.xml of maven itself. After I fixed the maven proxy setting no exception occured and the deployment was successful.