0

I followed this SO post:

What are Java command line options to set to allow JVM to be remotely debugged?

and was able to remotely debug my Java app that runs as a windows service through prunsrv / procrun.

When I run the service with option suspend=n, I am able to connect remote debugger through eclipse:

myservice.exe //US//myservice --JvmOptions "-agentlib:jdwp=transport=dt_socket,address=127.0.0.1:8111,server=y,suspend=n"

but when I give option suspend=y, I get the following error:

Commons Daemon procrun failed with exit value: 5 (Failed to start service)

any idea why suspend=y is resulting in this error. (Unfortunately detailed logs for prunsrv are not generated)

tryingToLearn
  • 10,691
  • 12
  • 80
  • 114
  • 1
    I suspect that your service check that JVM is alive and if you use `suspend=y` this check fails. – talex Mar 22 '19 at 06:57
  • but when I check task manager, `myservice.exe (procrun)` is running. – tryingToLearn Mar 22 '19 at 07:02
  • @talex you were right. The way I validated this was, if I start my remote debugger within 2-3 secs of giving the start command to service, I did not see above error. This 2-3 seconds might be the validation time for checking for JVM alive. – tryingToLearn Mar 26 '19 at 06:38

0 Answers0