In order to use remote debugging, you will need to attach your IDE to a (JPDA) debugging port on the JVM of your web container. In order to do this you will need to start your web container with special parameters to equip it with such a port. By default jZeno runs on Winstone (a servlet-only container) by using the run.sh/run.bat script. This script is allready set up to have a JPDA port, so you don't need to do anything extra. If you're using Tomcat however, you need start it with with the jpda parameter, like this :
$ ./catalina.sh jpda run Using CATALINA_BASE: /home/codehawk/opt/jakarta-tomcat-5.5.9 Using CATALINA_HOME: /home/codehawk/opt/jakarta-tomcat-5.5.9 Using CATALINA_TMPDIR: /home/codehawk/opt/jakarta-tomcat-5.5.9/temp Using JRE_HOME: /home/codehawk/opt/jdk1.5.0_05 Listening for transport dt_socket at address: 8000 Nov 12, 2005 9:41:26 PM org.apache.coyote.http11.Http11Protocol init ...
Note the line that says Listening for transport dt_socket at address: 8000. This tells you that the debugging port is TCP/IP port 8000. In fact 8000 is very often the default JPDA port. It is possible to start any JVM with such a port, so by definition it is possible on any web container !
In order to start java with a JPDA port you need to add these arguments :
java -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n ...
Now that you have done this you still need to attach your IDE to this new debugging port. Any modern IDE has this capability. In Eclipse click on Run menu and select the Debug... option. You are now presented with a dialog to add/configure debugging sessions. Create a new session under the section Remote Java Application and configure it with the right parameters. An example is given below :
Once you have configured the debug session, activate it by clicking the Debug button at the bottom. You are now connected to the JVM of your web container. You can use this session to place break-point, inspect variables, etc.. inside your running application. Adding a breakpoint in eclipse is done by double clicking the (left-hand) margin of the code editor on the line you want a breakpoint.