Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to debug web applications using Eclipse?

I am working on a web application using the Eclipse Java IDE.

I am using Tomcat 6 as my servlet container.

The tools available for Java, inculding Eclipse, seem to lack debugging capabilities for web applicatons (as compared to Visual Studio for the .NET platform).

How can I debug my web app using Eclipse?

like image 697
Lokesh Sah Avatar asked Mar 21 '11 07:03

Lokesh Sah


2 Answers

run tomcat in debug mode (java option -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000) and then use remote debug in Eclipse (Debug Configurations -> Remote Java Aplication) and connect to server on configured port (e.g. 8000 in this example).

like image 91
michal.kreuzman Avatar answered Oct 04 '22 04:10

michal.kreuzman


If you want to debug your web application, set breakpoints where desired and run Tomcat on debug mode. If you logged your exceptions or placed INFO/DEBUG messages, you can view them on Console (if ConsoleAppender is used).

The essential thing is that your application runs on debug mode. For browser side debugging (as @Thomas said), there's tools like Chrome Debugger (for Google Chrome), Firebug (for Firefox) and Firebug Lite (for other browsers).

like image 45
Buhake Sindi Avatar answered Oct 04 '22 04:10

Buhake Sindi