title: IntelliJ - Remote debug - Unable to open debugger port
body: <p>I am using IntelliJ 2017.3 with Payara 4.1.2.172. I used to just start the server from the command line had a Remote Debug running on port 9009, and everything used to work fine.
  <a href="https://i.stack.imgur.com/Jvv4m.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Jvv4m.png" alt="enter image description here"></a></p>
  
  <p>Then I set up an plugged in server with attached modules in IntelliJ, to enable HotSwap. I run this server in debug mode, and it works fine.</p>
  
  <p>Now, if I don't use the plugged in server, but want to start the server as previous, when I run the debug remote, I get the following:</p>
  
  <p><strong>Error</strong></p>
  
  <blockquote>
    <p>Error running 'Debug Glassfish OSM': Unable to open debugger port
    (localhost:9009): java.net.ConnectException "Connection refused:
    connect"</p>
  </blockquote>
  
  <p>I have run a netstat and there's nothing running on port 9009.</p>
  
  <p><strong>Question</strong></p>
  
  <p>How do I get the remote debug working on the server?</p>
  
  <p><strong>More info</strong></p>
  
  <p>The domail.xml has:</p>
  
  <pre><code>&lt;system-property name="JAVA_DEBUGGER_PORT" value="9009"&gt;&lt;/system-property&gt;
  </code></pre>
  
  <p>And in the server-config JVM Settings:</p>
  
  <p><a href="https://i.stack.imgur.com/EOjzP.png" rel="noreferrer"><img src="https://i.stack.imgur.com/EOjzP.png" alt="enter image description here"></a></p>
  
  <p><strong>More info</strong></p>
  
  <p>I set the above 'Enable' checkbox to on, but now I get the following error when I try start the server, i.e. the server won't start now. (netstat shows noting running on port 9009)</p>
  
  <blockquote>
    <p>ERROR: transport error 202: connect failed: Connection refused ERROR:
    JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
    JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports
    initialized [debugInit.c:750]</p>
  </blockquote>
  
  <p>If I set it to off in the damain.cml, I still get the error and am unable to start the server.</p>
  
  <pre><code>&lt;java-config classpath-suffix="" debug-options="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=${JAVA_DEBUGGER_PORT}" debug-enabled="true" system-classpath=""&gt;
  </code></pre>