Hi,
I have 2 Geronimo servers running on different boxes ...with the same
application resources.
I have a JMS Queue & a JMS Connection factory running on Box1 & Box2.
>From Box 1, I try to connect to a JMS resource on Box 2, it fails.
Here is my code
public Queue getRequestQueue(String hostName) {
if(hostName == null || hostName.length()==0)
return getRequestQueue();
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"org.activemq.jndi.ActiveMQInitialContextFactory");
env.put(Context.PROVIDER_URL, "tcp://server2:61616");
env.put(Context.SECURITY_PRINCIPAL,"geronimo");
env.put(Context.SECURITY_CREDENTIALS,"geronimo");
System.out.println("|
.......................................... |");
System.out.println("| The Hostname getRequestQueue for
connection
is:"+hostName);
System.out.println("|
.......................................... |");
try {
InitialContext naming = new InitialContext(env);
return (Queue) naming.lookup("Queue1");
} catch(NamingException e){
e.printStackTrace();
return null;
}
}
I always get the Queue1 object which is bound to Server1 instead of getting
the object bound to Server2.
Is there anything i am doing wrong here ?
--
View this message in context:
http://www.nabble.com/ActiveMQ-3.2.2-tf2074683.html#a5713245
Sent from the ActiveMQ - User forum at Nabble.com.