Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting debug configuration for maven+jetty+eclipse

I have created a web app using maven in eclipse. I am using jetty for running the app. I am able to run the app using the maven jetty plugin. But I am facing difficulty while debugging the app - The steps that i have followed to setup debug settings are from the below link http://www.clickonchris.com/2010/05/configuring-jetty-maven-and-eclipse-together-with-hot-deploy/

I can run the app at port 8080 and it keeps on Listening for transport dt_socket at address: 4000. For debugging i have given port 4000. But when i start the debugger in eclipse it gives me a window with following error - "Failed to connect to remote VM. Connection refused. Connection refused: connect" Can some one help me out in resolving this issue for debugging the app.

Thanks!!!

like image 795
azhar_salati Avatar asked Oct 24 '11 11:10

azhar_salati


People also ask

How do I run a Jetty server in eclipse?

Running the Web ApplicationSelect the application you want to run on Jetty. Click on the Run button -> Run Configurations. Configure your app on Jetty as shown in the picture bellow and click on Run: Wait for the server to start.


1 Answers

Set MAVEN_OPTS using -

export MAVEN_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"

Then start jetty using -

mvn jetty:run

Start remote debugging from your fav IDE on port 8000

like image 72
Kapil Raju Avatar answered Sep 20 '22 03:09

Kapil Raju