Community
Participate
Working Groups
Build Identifier: Problem: I have my own shutdown hook registered that calls Server.stop() Server.doStop calls ShutDownThread.deregister which ends up calling Runtime.addShutdownHook in ShutdownThread's constructor. Runtime.addShutdownHook then causes an IllegalStateException because shutdown is already in progress: java.lang.IllegalStateException: Shutdown in progress at java.lang.Shutdown.add(Shutdown.java:81) at java.lang.Runtime.addShutdownHook(Runtime.java:190) at org.eclipse.jetty.util.thread.ShutdownThread.<init>(ShutdownThread.java:48) at org.eclipse.jetty.util.thread.ShutdownThread.<clinit>(ShutdownThread.java:36) at org.eclipse.jetty.server.Server.doStop(Server.java:315) at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:80) Solution: ShutDownThread.deregister in Server.doStop should probably be protected by an if(getStopAtShutdown()) as is ShutdownThread.register in doStart(). Reproducible: Always Steps to Reproduce: 1. Create and register a custom shutdown thread that will call Server.stop 2. Start server 3. Stop server 4. Observe stacktrace.
Fixed thanks! r1772