tags:

views:

548

answers:

4

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.

A: 

You could run the application via the 'Run Jetty Run' Eclipse plugin, rather than the Maven jetty plugin. Eclipse has more direct control over the new JVM then.

Jherico
A: 
biggusjimmus
+1  A: 

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.

Robert Munteanu
A: 

It seems that I forgot to tick "Allow termination of remote VM". Strange that it didn't seem to work before.

seanlinmt