-
Bug
-
Resolution: Done
-
Major
-
7.4.1.GA
-
False
-
False
-
-
-
-
-
-
+
-
-
Consider there's a servlet like this:
@WebServlet(urlPatterns = "/async-module", asyncSupported = true) public class AnAsyncServlet extends HttpServlet { @Override public final void doGet(final HttpServletRequest request, HttpServletResponse response) throws ServerException, IOException { final AsyncContext asyncContext = request.startAsync(); asyncContext.start(new Processing("java:module/ApplicationConfig!org.jboss.ConfigInterface", (HttpServletResponse) asyncContext.getResponse())); } }
and that Processing class is doing a JNDI lookup of the JNDI name in the java:module namespace as above, like:
public class Processing implements Runnable { private final HttpServletResponse response; private final String jndi; public Processing(final String jndi, final HttpServletResponse response) { super(); this.response = response; this.jndi = jndi; } @Override public void run() { String result; try { result = ((ConfigInterface) new InitialContext().lookup(jndi)).getConfigValue(); response.setStatus(HttpServletResponse.SC_OK); response.getWriter().write(result); response.getWriter().flush(); response.getWriter().close(); } catch (Exception e) { throw new RuntimeException("Error", e); } } }
As the AsyncContext should be container managed, the lookup of the java:module namespace should be possible.
Attached you can find the reproducer.zip, it contains a README.txt that explains how to reproduce this issue.
- is caused by
-
UNDERTOW-1989 Setup actions are not executed when using the async Start method
- Resolved