For debugging servlets, you simply start Tomcat up on the server machine in jpda mode, 
make sure you have a project in eclipse with all of your servlet code (compile with 
debug information, which in my eclipse is the default), and put a breakpoint in the 
servlet code.  Connect to the Tomcat debug process.  Then, hit the servlet with a 
browser, and your debugger should stop at your breakpoint no problem.

JSPs are trickier since the source code is generated at runtime.  You CAN pull in the 
.java file from the tomcat work directory, put it in your project, and maybe have some 
luck at getting a breakpoint set.  (I do not know if it would be compiled with debug 
information or not though.  You could use a precompilation script to guarantee this).  
There might be some Eclipse plugins that do JSP source-level debugging now, though I 
haven't seen one.

If you have to debug servlet init code, that is a bit trickier, though not much.  
Simply change catalina.sh, where it has the JPDA arguments, changing "suspend=n" to 
"suspend=y".  Then the Tomcat java process will start up and immediately suspend 
itself until you connect with the debugger and resume the process.

For servlets, there is nothing too different than debugging any other plain java code.

>>> [EMAIL PROTECTED] 12/5/03 8:26:12 AM >>>
Hi,
    I read the message in tomcat-user list about eclipse, tomcat and jpda, but i don't 
understand very well. I have two machines, one is a tomcat server and the other 
machine is my workstation. I execute tomcat with "./catalina.sh jpda run" and i can 
connect with eclipse when I try to debug. This is a client machine. But, I don't debug 
anything. The project to debug where would it  stay??? In server or client machine??? 
Moreover, how can i execute the jsp or sevlet??? With URL http://server:8080/ ????
Thanks
SERGI



---------------------------------
Yahoo! Sorteos
¡Ya puedes comprar Lotería de Navidad!

Jeff Tulley  ([EMAIL PROTECTED])
(801)861-5322
Novell, Inc., The Leading Provider of Net Business Solutions
http://www.novell.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to