Skip to content

Instantly share code, notes, and snippets.

@almibe almibe/VertxService.java
Last active Nov 23, 2015

Embed
What would you like to do?
Vert.x 3.1 OSGi shutdown issue
/*
Error produced:
Nov 23, 2015 6:05:36 PM io.netty.util.ThreadDeathWatcher$Watcher notifyWatchees
WARNING: Thread death watcher task raised an exception:
java.lang.NoClassDefFoundError: io/netty/util/Recycler$WeakOrderQueue
*/
private void stop() { //called by OSGi container
stopServer();
}
public void stopServer() {
CountDownLatch latch = new CountDownLatch(1);
vertx.close(handler -> {
latch.countDown();
});
// works fine with this sleep
// try {
// Thread.sleep(1000);
// } catch (Exception ex) {
// throw new RuntimeException(ex);
// }
try {
latch.await();
} catch (Exception ex) {
throw new RuntimeException(ex);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.