Accepted answer

if you run your war with tomcat/jetty plugin pass debug options to the maven:

export maven_opts="-xnoagent -xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000" mvn tomcat:run

if you run your war using the regular tomcat, just run it with jpda (debugger) support enabled:

$tomcat_home/bin/ jpda start

default port for tomcat 6 jpda is 8000.

now connect with the eclipse (debug -> remote java application) to the port 8000 and enjoy your fine debugging session.


is there some kind of launch configuration i should create, or do i attach the debugger remotely? is there something in eclipse that can a plugin?

with m2eclipse (and the maven integration for wtp that you install from the extras), you could use the wtp and start your app in debug mode.

as an alternative, you could connect a remote debugger to a jetty. see debugging with the maven jetty plugin in eclipse.


a better way of adding the debugging options to $maven_opts option, and thus not merging them with the other existing options (if you want to start your app not in the debug mode, you have to remove those options again), is to use the maven out of the box debugger mvndebug, located in its bin directory, this way mvndebug jetty:run. this will execute your app in debug mode and what's remaining is attaching your debugger.


to enable debugging through eclipse :

i pass following to tomcat startup:

-xnoagent -xrunjdwp:transport=dt_socket,server=y,address=9999,suspend=n

then through eclipse do remote debug.

  • goto debug menu > debug configuration

  • scroll down to select remote java application

  • rt click to create new
  • select connection type as standard (socket attach) and add hostname and port.

to start debugging simple open it when server is running.---

Related Query

More Query from same tag