The Artima Developer Community
Sponsored Link

Java Buzz Forum
Using eclipse to debug your tomcat web application

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Andrej Koelewijn

Posts: 594
Nickname: andrejk
Registered: Nov, 2002

Andrej Koelewijn is a Java and Oracle consultant
Using eclipse to debug your tomcat web application Posted: Oct 23, 2003 4:24 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Andrej Koelewijn.
Original Post: Using eclipse to debug your tomcat web application
Feed Title: Andrej Koelewijn
Feed URL: http://feeds.feedburner.com/AndrejKoelewijn
Feed Description: On Oracle, Java and OpenSource
Latest Java Buzz Posts
Latest Java Buzz Posts by Andrej Koelewijn
Latest Posts From Andrej Koelewijn

Advertisement

Got this question again today. Usually i'd say: use the tomcat plugin, but in this case tomcat 3.2.4 is used, as that's the tomcat version the web server is still using. The eclipse tomcat plugin only supports tomcat 3.3 and up.

Here's what you do:

  • Start java with remote debugging enabled. You do this by modifying tomcat.bat (assuming you're on windows). You have to add some parameters when starting java. If you start tomcat from a cmd box, look for the line "echo Starting Tomcat in new window" in tomcat.bat. Add the following line:
    set JAVA_X_OPTS=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5000
    And modify the star t java line as follows:
    %_STARTJAVA% %TOMCAT_OPTS% -Dtomcat.home="%TOMCAT_HOME%" org.apache.tomcat.startup.Tomcat %2 %3 %4 %5 %6 %7 %8 %
    Now you can start tomcat by typing startup.bat in your cmd box.
  • Click on the debug button in your eclipse toolbar. Select the "Debug..." item. This will open a debug window. Under configurations you'll find an entry "Remote Java Application". Select this and then press the new button. Choose a project, leave the connection type to "standard (socket attach)" and for connection properties choose "localhost" and "5000" (change these if you're using a different port or a different machine to run tomcat). Now press apply and debug.

That's it. You can now set breakpoints in your code, and inspect what your application is doing.

Read: Using eclipse to debug your tomcat web application

Topic: Pro JSP, 3rd Edition has arrived! Previous Topic   Next Topic Topic: I just saw Necropolis Awakened a really, really ...

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use