NullPointerException in JndiLoginInitialContextFactory.getInitialContext() in JBoss EAP

Solution Verified - Updated -


  • I'm trying to do do a JNDI lookup using the jbossall-client.jar in my client application in JBoss EAP 6. The the configuration is shown below and I'm getting a NullPointerException when trying to setup the initial context, what is causing this?
        Properties properties = new Properties();
        properties.put(Context.INITIAL_CONTEXT_FACTORY, "");
        properties.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
        properties.put("jnp.socket.Factory", "org.jnp.interfaces.TimedSocketFactory");
        properties.setProperty("java.naming.provider.url", "jnp://remotehost:1099");
        MyBean bean = new InitialContext(properties).lookup("example");

The exception I'm getting is:

        at [jbossall-client.jar:4.3.0.GA_CP09 (build: SVNTag=JBPAPP_4_3_0_GA_CP09 date=201011090309)]
        at javax.naming.spi.NamingManager.getInitialContext( [rt.jar:1.6.0_16]
        at javax.naming.InitialContext.getDefaultInitCtx( [rt.jar:1.6.0_16]
        at javax.naming.InitialContext.init( [rt.jar:1.6.0_16]


  • JBoss Enterprise Application Platform (EAP)
    • 6.x
  • Using JBoss EAP 4.3 jbossall-client.jar library to call EJBs in JBoss EAP 4.3

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