title: Tomcat 7: Connection reset by peer or Software caused connection abort
body: <p>I have a problem when I'm trying to deploy Java-application.    </p>
  
  <pre><code>Cannot invoke Tomcat manager: Connection reset by peer: socket write error
  </code></pre>
  
  <p>or </p>
  
  <pre><code>Cannot invoke Tomcat manager: Software caused connection abort: socket write error
  </code></pre>
  
  <p>In <i>pom.xml</i> I have this:</p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;org.apache.tomcat.maven&lt;/groupId&gt;
      &lt;artifactId&gt;tomcat7-maven-plugin&lt;/artifactId&gt;
      &lt;version&gt;2.2&lt;/version&gt;
      &lt;configuration&gt;
          &lt;url&gt;http://localhost:8085/manager/html&lt;/url&gt;
          &lt;server&gt;tomcat7&lt;/server&gt;
          &lt;path&gt;/java_web&lt;/path&gt;
          &lt;username&gt;admin&lt;/username&gt;
          &lt;password&gt;admin&lt;/password&gt;
      &lt;/configuration&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>In <i>tomcat-users.xml</i> I have this:</p>
  
  <pre><code> &lt;tomcat-users&gt;
       &lt;role rolename="admin"/&gt;
       &lt;role rolename="manager-script"/&gt;
       &lt;role rolename="manager-gui"/&gt;
       &lt;role rolename="manager-jmx"/&gt;
       &lt;user username="admin" password="admin" roles="manager-gui,admin,manager-jmx,manager-script" /&gt;
   &lt;/tomcat-users&gt;
  </code></pre>
  
  <p>Also in <i>Maven/conf/settings.xml</i> I have:</p>
  
  <pre><code>&lt;server&gt;
      &lt;id&gt;tomcat7&lt;/id&gt;
      &lt;username&gt;admin&lt;/username&gt;
      &lt;password&gt;admin&lt;/password&gt;
  &lt;/server&gt;
  </code></pre>
  
  <p>When I'm trying to go to</p>
  
  <pre><code>http://localhost:8085/manager/html/deploy?path=%2Fjava_web&amp;update=true
  </code></pre>
  
  <p>and input username and password (admin admin) I have error:</p>
  
  <pre><code>403 Access Denied
  You are not authorized to view this page.
  </code></pre>
  
  <p>But I typed in <i>tomcat-users.xml</i> that user admin has manager-gui role. 
  I'm using Tomcat 7.0.56 and Jenkins. Also use commands: clean and tomcat7-redeploy.
  Need help to understand what is wrong:C</p>