The needed params are:
-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n
For jboss as 7 in bin/standalone.bat (or sh) add those additional params to line 53
set JAVA_OPTS=-Dprogram.name=%PROGNAME% %JAVA_OPTS%
the line will look like this:
set JAVA_OPTS=-Dprogram.name=%PROGNAME% %JAVA_OPTS% -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n
For tomcat/tomee
in catalina.bat (.sh) at this as the first line in file:
set JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n
To debug the code in Eclipse:
- Run -> Debug Configurations… -> Remote Java Application -> Right click –> New
- Then on Connect tab, set these Connection Properties: host = localhost, port=8787
- Then select your Project and in Source tab add extra projects or libraries.
- Press Apply button
- Press Debug button
- You are connected!!! – the server must be started
- Add a Breakpoint in your code
- Trigger your application to reach a Breakpoint
To debug the code in Netbeans:
- Go in menu: Debug->AttachDebuger…
- set port to 8787
- press ok (make sure that the server is up and running) – repeat the process every time when you need debugging
No comments:
Post a Comment