JBoss Community

Re: JNDI Standalone client

created by Wolfgang Knauf in Beginner's Corner - View the full discussion

Hi,

 

for a standalone client, you have to provide a configuration for the InitialContext:

 

        Properties props = new Properties();

        props.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");

        props.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming.client");

        props.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099");

       

        InitialContext initialContext = new InitialContext(props);

 

Do you want to perform a lookup in global JNDI or do you lookup something in your "Environment naming context"?

 

Best regards

 

Wolfgang

Reply to this message by going to Community

Start a new discussion in Beginner's Corner at Community