File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes How to configure Tomcat 5.5 for debug mode? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "How to configure Tomcat 5.5 for debug mode?" Watch "How to configure Tomcat 5.5 for debug mode?" New topic

How to configure Tomcat 5.5 for debug mode?

Maya Dolas

Joined: Jul 04, 2007
Posts: 26

I am facing few problems while setting up my application for debug mode. I am using Tomcat5.5 and Eclipse 3.2. I am using Win-XP

I have made the following entry

1. Added these two environment variables: JPDA_ADDRESS=8000 and JPDA_TRANSPORT=dt_socket

2. I have added the following entry in tomcat GUI control under the Java tab in Java Options textbox
Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n

3. Have configured in my eclipse debug for remote java application using the option in Run->Debug with appropriate port=8000 and host(localhost).

Also my code resides on E:\MyProjects\FundTransfer

To deploy the application on Tomcat there is ANT file which I need to run which creates a war file in webapps of Tomcat.

I am stuck as in Tomcat5 we had a command for debug "catalina jpda start". What is it in Tomcat5.5.

Also have a doubt if I define a XML file int the CATALINA_HOME\conf\Catalina\localhost folder having only the <Context> entry, I need to point the docbase attribute to E:\.... till the folder which has WEB-INF in it? OR to the folder to which the war gets exploded and the folder containing the WEB-INF there?

Pointers and suggestions for same are greatly appreciated.

Thank you.

Pavel Cherkashin
Ranch Hand

Joined: Mar 04, 2005
Posts: 47
Open catalina.bat
and write in very first lines

then start tomcat standalone without Eclipse or MyEclipse
use command:

tomcat will rise up and it will open debug port 8000 (or whichever you specified)
Open Your IDE and tune Remote Debug on your host (if you start it locally - then localhost), specifi transport as dt_socket and port 8000. Start debuger in your IDE - now it is possimbe to catch breakpoints.

The second way is to run your tomcat directly from your IDE as a java application in debug mode. Exadel plug-ins do this, MyEclipse does, IDEA does also. Not all IDEs support this feature, but almost all support remote debug. Anyway If You refer Tomcat docs You even can start it as a plain console java application in debug mode.

The advantage of Remote Debug - you can use it even with remotely located servers.

Pavel Cherkashin - <br />SCJP, SCWCD, SCDJWS, SCBCD, SCEA, ...<br />
I agree. Here's the link:
subject: How to configure Tomcat 5.5 for debug mode?
It's not a secret anymore!