Sunday, October 11, 2009

Configure debug port in Tomcat 5.5

I have installed Tomcat 5.5 using setup.exe. After the installation I get following two executable files in my %TOMCAT_HOME%/bin directory:
  • tomcat5.exe - which launches the server.
  • tomcat5w.exe - which allows you to configure tomcat.
Launch tomcat5w.exe and click on Java tab. Under java options add the following line:

-Xrunjdwp:transport=dt_socket,address=8453,server=y,suspend=n

where 8453 is your socket number. Now in eclipse or any other IDE you can easily configure options to debug the application.

I haven't tried this on tomcat's other distribution in which you simple unzip the files for installation. In this case you have to edit catalina.bat file. That's all information I got from various forums.

Smile !!! :)
-- Updated 23rd August, 2011--
In case if you have unzipped tomcat or your are on Linux machine, then "tomcat5w.exe" won't work. In that case, instead of starting tomcat with "startup.sh" script, execute the following command.
catalina.bat jpda start
You can do the same on windows as well. By default your debug port will be 8000.
Thanks.

No comments: