Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

maven jetty does not shutdown properly in eclipse

Tags:

java

eclipse

I am currently running jetty from eclipse as an external java program. The problem is when I terminate jetty and I try to relaunch it again, it cannot due to the port still being in use.

What I have to do is open up Windows Task Manager and kill the java process manually. How do you get jetty to shutdown/terminate/end nicely?

The following are my maven jetty application settings

Arguments: jetty:run-war

MAVEN_OPTS: -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket, address=8080,server=y, suspend=y

Setting suspend=n doesn't seem to solve the problem either.

like image 883
sean Avatar asked Feb 26 '26 05:02

sean


1 Answers

If a java application does not shutdown it is because of an alive non-daemon thread. Try getting a thread dump of the running maven process, e.g. using VisualVM and see what keeps the application alive.

like image 161
Robert Munteanu Avatar answered Feb 28 '26 17:02

Robert Munteanu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!