JNDI Lookup question
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ryan_Wang
Posted On:   Tuesday, October 18, 2005 05:44 AM

I have two separate OC4J containers with identical code deployed to both. I want to call some code on one container from the other. All code is in the form of EJBs. I firstly have to do a JNDI lookup: InitialContext context = new InitialContext(); Object ref = context.lookup("jndiNameOfRemoteEJB"); I can then perform the appropriate casts to get the remote ejb object I need. My questions are: 1) Where and how do I initially register the "jndiNameOfRemoteEJB" with the EJB in the registry? 2) When I have identical code deployed to both containers (with the same deployment descriptors) how does it know   More>>


I have two separate OC4J containers with identical code deployed to both.



I want to call some code on one container from the other. All code is in the form of EJBs.



I firstly have to do a JNDI lookup:

			

InitialContext context = new InitialContext();
Object ref = context.lookup("jndiNameOfRemoteEJB");



I can then perform the appropriate casts to get the remote ejb object I need.


My questions are:
1) Where and how do I initially register the "jndiNameOfRemoteEJB" with the EJB in the registry?
2) When I have identical code deployed to both containers (with the same deployment descriptors) how does it know which container's code should be executed? When I do a lookup for an EJB, how can I be sure it has looked up the EJB in the correct container?

   <<Less

Re: JNDI Lookup question

Posted By:   ankush_purwar  
Posted On:   Wednesday, October 19, 2005 07:07 AM

During creation of initial context , you can pass a properties file or hashtable to constructor of initialcontext class.

And hashtable contains url of server where it will tries for lookup JNDI names each time.
About | Sitemap | Contact