9

I'm looking to run my Dropwizard 0.8.5 app in debug mode whereby:

  • The app is running locally, using JPDA; and
  • In my IDE (Eclipse) I set breakpoints and use a JPDA client to connect to my locally running app (I think this is how it goes)

For the server debug mode:

Typically my DW app runs from the command-line like so:

java -jar build/libs/myapp.jar server src/test/resources/myapp-local.yml

So what are the command-line args to get this running in debug mode (JPDA), or what are the modifications to myapp-local.yml needed to accomplish this?


For Eclipse/JPDA Client

I assume I just set breakpoints and then create a new Debug Configuration inside Eclipse, but not sure what arguments/configs to set this Configuration up with. Any ideas?

smeeb
  • 27,777
  • 57
  • 250
  • 447

1 Answers1

13

Just run the main class (the one that extends Application<T>) in debug mode. You will need to set the program parameters as "server src/test/resources/myapp-local.yml" in your run configurations.

dkulkarni
  • 2,780
  • 4
  • 27
  • 36
  • Thanks @dkulkarni (+1) - **what if I want to debug a remote running DW app, say, one of our DEV or QA servers?** – smeeb Nov 16 '15 at 14:07
  • 3
    First, you will need to add multiple options to your `java -jar` command to setup remote debugging. You can then attach a listener in Eclipse to debug remotely. Detailed instructions here: http://www.eclipse.org/jetty/documentation/current/enable-remote-debugging.html – dkulkarni Nov 16 '15 at 14:19