EAP 7.4 JNDI lookup of 'java:module' namespace fails with NameNotFoundException from AsyncContext

Solution Verified - Updated -


JNDI lookup of 'java:module' namespace fails with NameNotFoundException from AsyncContext.
Example, consider there's a servlet like this:

@WebServlet(urlPatterns = "/async-module", asyncSupported = true) <---- async
public class AnAsyncServlet extends HttpServlet {

    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", //<--------------- 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 { //<--- Processing class

    private final HttpServletResponse response;
    private final String jndi;

    public Processing(final String jndi, final HttpServletResponse response) {
        this.response = response;
        this.jndi = jndi;

    public void run() {
        String result;
        try {
            result = ((ConfigInterface) new InitialContext().lookup(jndi)).getConfigValue();

        } catch (Exception e) {
            throw new RuntimeException("Error", e);


  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7.4

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content