Show Table of Contents
7.2. Configuring a Remote JNDI Client
Remote JNDI clients can look up and connect to objects by name using JNDI. The client must have
jboss-client.jar on its class path.
The following example shows how to look up the
myTestQueue JMS queue from a remote JNDI client:
Example 7.2. Example Remote JNDI Lookup
Properties properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
properties.put(Context.PROVIDER_URL, "remote://<hostname>:4447");
context = new InitialContext(properties);
Queue myTestQueue = (Queue) context.lookup("jms/queue/myTestQueue");

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.