subhashis
subhashis

Reputation: 4878

How to debug java application in Eclipse deployed in tomcat?

I am working on an web application deployed in tomcat, the problem I am facing is neither it is allowing me to add to tomcat server nor it is allowing me to run on debug mode.

enter image description here

Upvotes: 1

Views: 1932

Answers (2)

Steffen Harbich
Steffen Harbich

Reputation: 2749

To run and debug a Java web application in Eclipse, you need to have a dynamic web project. The error message in your screen shot implies you haven't one. Have a look at the excellent tutorials of Lars Vogel:

http://www.vogella.com/tutorials/EclipseWTP/article.html

Upvotes: 1

Thomas
Thomas

Reputation: 88707

To debug an application running on an external tomcat, set that tomcat to allow remote debugging, e.g. with JVM params like this:

-agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n 

Then create a new remote "Remote Java Application" debug config, select connection type "Standard (Socket Attach)" and provide host and port (in the example above the port would be 8787).

Upvotes: 3

Related Questions