From a4b9f19e26c552233381279bdc6900ae765cf4eb Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Tue, 5 Jul 2022 09:32:22 +1000 Subject: [PATCH] Fix injection of AsyncListener --- .../java/org/eclipse/jetty/ee10/servlet/AsyncContextState.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/jetty-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/AsyncContextState.java b/jetty-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/AsyncContextState.java index 4d485b7bbfb..abf396ddfa6 100644 --- a/jetty-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/AsyncContextState.java +++ b/jetty-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/AsyncContextState.java @@ -64,10 +64,9 @@ public class AsyncContextState implements AsyncContext @Override public T createListener(Class clazz) throws ServletException { - // TODO: Use ServletContextHandler createInstance use DecoratedObjectFactory. try { - return clazz.getDeclaredConstructor().newInstance(); + return state().getContextHandler().getContext().getServletContext().createInstance(clazz); } catch (Exception e) {