我试图清理关闭灰熊服务器。我正在调用httpServer.shutdown()
然而,当我运行“mvm clean test”时,我收到了像
这样的警告Aug 03, 2014 10:39:00 PM org.glassfish.grizzly.http.server.NetworkListener start
INFO: Started listener bound to [localhost:8081]
Aug 03, 2014 10:39:00 PM org.glassfish.grizzly.http.server.HttpServer start
INFO: [HttpServer] Started.
Aug 03, 2014 10:39:00 PM org.glassfish.grizzly.http.server.NetworkListener shutdownNow
INFO: Stopped listener bound to [localhost:8081]
Aug 03, 2014 10:39:00 PM org.glassfish.grizzly.nio.GracefulShutdownRunner run
WARNING: GRIZZLY0030: Shutting down transport TCPNIOTransport[428da4da] in 10,000 SECONDS.
Aug 03, 2014 10:39:00 PM org.glassfish.grizzly.nio.GracefulShutdownRunner run
WARNING: GRIZZLY0032: Primary shutdown thread interrupted. Forcing transport termination.
这是关闭主机的代码。
protected static void shutdownGrizzlyWebServer(HttpServer grizzlyWebServer) {
if (grizzlyWebServer != null && grizzlyWebServer.isStarted()) {
GrizzlyFuture<HttpServer> future = grizzlyWebServer.shutdown(10000, TimeUnit.MILLISECONDS);
while (!future.isDone()) {
try {
Thread.sleep(2000);
} catch (InterruptedException ignore){
System.out.println(ignore);
}
}
有谁知道这里出了什么问题?非常感谢你。