Reputation: 13
The problem:
Debugging a java web application deployed in Tomcat 7 is not working. Eclipse seems to connect to Tomcat but breakpoints are ignored when I try to debug. I did the following:
First of all I have also tried: Remote debugging Tomcat with Eclipse.
started Tomcat7 in debug mode with :
set JPDA_OPTS=-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n
catalina.bat jpda start
Debug as - > Remote Java Application with host : localhost
and port : 8000
.
Created a few breakpoints on a servlet where the request should suspend and let me debug but it's like there is no breakpoint set.
Thank you all,
Daniel
P.S. This is my first question so please be kind .
Upvotes: 1
Views: 3527
Reputation: 23535
One possible explanation is that the class files in your WAR file (deployed on Tomcat) do not contain line numbers.
If you told us with which compiler and compiler plugin (Oracle javac
, Eclipse, ANT, Maven, etc.) the class files were produced and what settings were used we may be able to provide further details.
Update
Author says in comment that ANT is used to compile. Follow-up:
The ANT javac task is just a wrapper around a concrete compiler. So, the options you can set depend on the actual javac
. However, what you're looking for is debug="true" debuglevel="lines"
. ANT will then pass -g:lines
to javac
(see docs).
Sidenote: optimize="true"
is ignored (check the docs).
Upvotes: 3