diff --git a/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/deploy/WebSocketServerContainerInitializer.java b/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/deploy/WebSocketServerContainerInitializer.java index f072cd864f1..10ff77af90f 100644 --- a/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/deploy/WebSocketServerContainerInitializer.java +++ b/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/deploy/WebSocketServerContainerInitializer.java @@ -98,6 +98,7 @@ public class WebSocketServerContainerInitializer implements ServletContainerInit { // Create Filter WebSocketUpgradeFilter filter = WebSocketUpgradeFilter.configureContext(context); + filter.getFactory().init(context); // Create the Jetty ServerContainer implementation ServerContainer jettyContainer = new ServerContainer(filter,filter.getFactory(),context.getServer().getThreadPool()); @@ -123,6 +124,7 @@ public class WebSocketServerContainerInitializer implements ServletContainerInit { // Create Filter WebSocketUpgradeFilter filter = WebSocketUpgradeFilter.configureContext(context); + filter.getFactory().init(context); // Create the Jetty ServerContainer implementation ServerContainer jettyContainer = new ServerContainer(filter,filter.getFactory(),jettyContext.getServer().getThreadPool()); @@ -247,8 +249,7 @@ public class WebSocketServerContainerInitializer implements ServletContainerInit { // Create the Jetty ServerContainer implementation ServerContainer jettyContainer = configureContext(context,jettyContext); - - context.addListener(new ContextDestroyListener()); //make sure context is cleaned up when the context stops + context.addListener(new ContextDestroyListener()); // make sure context is cleaned up when the context stops // // Establish the DecoratedObjectFactory thread local // // for various ServiceLoader initiated components to use.