14
votes

I'm developping a web application in Eclipse and I'm using maven, spring and tomcat. Now the problem I have is that debug as => debug on server doesn't work. I just get exceptions. (and yes I've created the server)

If I use the mvn command to compile it, put the war in my tomcat webapps dir and start my tomcat the application works fine. But for the functionallity I'm now working on debugging would be usefull.

3
You need to post more details. For example what are the exceptions? That would go a long way towards understanding the problem. - drekka

3 Answers

9
votes

I found the answer for this in http://jacksonps4.me/wordpress/?p=868

Worked like a charm for me, yet I don't understand anything!

3
votes

We used to test our application with Tomcat as well, but switched to starting an embeddable Jetty. Here's a sample app. It's JSF, but it doesn't really matter. The pseudo-unit test simply starts a jetty "before" and shuts stops it "after". No need for external server infrastructure, no need for IDE dependencies.

2
votes

you can run tomcat with maven with this command:

mvn tomcat:run

and if you want to debug, set this maven options:

export MAVEN_OPTS=-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000

if you are in windows, use the set command:

set MAVEN_OPTS=-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000

then you can debug with eclipse Remote Java Application.

Hope this help.