Category Archives: Tomcat

Remote debugging eclipse with tomcat


Its extremely basic -but I always miss a step or so and end up searching on google. So I though I will just Jot it down -more so for me!

  • In bin/catalina.bat add following

    set JPDA_OPTS=-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n
  • For starting tomcat, do not use startup.bat instead navigate to bin folder from command prompt and use following command to start tomcat
    “catalina.bat jpda start”
  • If tomcat starts listening successfully -it should print a message as

    “Listening for transport dt_socket at address: 8000”
  • Next In eclipse,

    1. select the project and click on debug->debug configurations Under “Remote Java application” -create a new configuration, and then enter

      Host -> localhost

      Port -> 8000 (same as given in address for JPDA_OPTS)
    2. All set ..eclipse should be able to connect to tomcat and debug points should be enabled in webapp

      Advertisements

Starting tomcat 6 in debug mode


create a debug.bat file in bin directory of tomcat. Add following lines

@echo off
set JPDA_TRANSPORT=”dt_socket”
set JPDA_ADDRESS=”8000″
set JPDA_SUSPEND=”y”

Fire command:
catalina.bat jpda start