title: Problem encountered while remote debugging java application as a service
body: <p>I followed this SO post:</p>
  
  <p><a href="https://stackoverflow.com/questions/138511/what-are-java-command-line-options-to-set-to-allow-jvm-to-be-remotely-debugged">What are Java command line options to set to allow JVM to be remotely debugged?</a></p>
  
  <p>and was able to remotely debug my Java app that runs as a windows service through <a href="https://commons.apache.org/proper/commons-daemon/procrun.html" rel="nofollow noreferrer">prunsrv / procrun</a>.</p>
  
  <p>When I run the service with option <code>suspend=n</code>, I am able to connect remote debugger through eclipse:</p>
  
  <pre><code>myservice.exe //US//myservice --JvmOptions "-agentlib:jdwp=transport=dt_socket,address=127.0.0.1:8111,server=y,suspend=n"
  </code></pre>
  
  <p>but when I give option <code>suspend=y</code>, I get the following error:</p>
  
  <blockquote>
    <p>Commons Daemon procrun failed with exit value: 5 (Failed to start
    service)</p>
  </blockquote>
  
  <p>any idea why <code>suspend=y</code> is resulting in this error. (Unfortunately detailed logs for prunsrv are not generated)</p>