File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes context.lookup Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "context.lookup" Watch "context.lookup" New topic



Joined: Jun 07, 2007
Posts: 15
Dear Sir,
i am trying for clustering of JMS where in mdb i have mention the local initialConext & lookup.As i am going for clustering i would have more lookup in the initial context. Can i know we integrated more context.lookup Present code is mention below. of Single instance.

try {
InitialContext context = new InitialContext();
apsBusinessServiceHome = (APSBlazeLocalHome)context.lookup(APS_BLAZE_SERVICE_BEAN_JNDI);
queueConnectionFactory = (QueueConnectionFactory)context.lookup(APS_RETURN_MESSAGE_QUEUE_CONNECTION_FACTORY);
queue = (Queue)context.lookup(APS_RETURN_QUEUE);
} catch (NamingException ne) {
throw new EJBException("Error JNDI Objects. Actual Exception is: " + ne.getMessage(), ne);


Thanks and regards
Bhavesh Shah
Amit M Tank
Ranch Hand

Joined: Mar 28, 2004
Posts: 257
more lookup in the initial context

What do you mean by more lookup in the initial context? Do you mean that you would be doing JNDI lookup in more than one machine? In that case you can pass the coma seperated url like t3://machine1 ort,t3://machine2 ort


Amit Tank
Linked In
subject: context.lookup
It's not a secret anymore!