title: Intellij debugging tomcat
body: <p>I know this has been asked a few times already but none of the posted solutions seem to help.  I'm trying to debug an application deployed on Tomcat installed locally.  </p>
  
  <p>Starting tomcat with these options:</p>
  
  <pre><code>set JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000 %JAVA_OPTS%
  </code></pre>
  
  <p>Created a remote debug configuration (NOT tomcat remote) and connecting to localhost/127.0.0.1 on port 8000.  I get this error:</p>
  
  <blockquote>
    <p>Unable to open debugger port (localhost:8000): java.io.IOException
    "handshake failed - connection prematurally closed"</p>
  </blockquote>
  
  <p>I should mention that I have done this same setup many times before and never faced any issue.  No idea why this is happening now.</p>
  
  <p>Thanks for any help!</p>