• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

bean relation

 
marcus don
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
how a j2ee client could reach a remote bean if I don't specify
the ip address of remote host?

Two beans can relate only if they are in the same .ear and they implements the local home/component interfaces. How a distributed enviroment could work if two remote beans could not relate?

Thank you.
 
Rudy Harianto
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On HFEjb page 118, the 2nd question:

it uses JNDI service to do this lookup.
and to know which JNDI does the bean registered, we have to pass info to the InitialContext constructor or use JNDI properties on client machine.

fortunately this is vendor specific, so it'll not show up in the exam.
 
marcus don
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rudy, thank you for your answer,

I've understood that using dd I can link one bean to another in a unidirectional/bidirectional way when they are local (CMR).

I still don't understand how a bean could locate another bean in this two cases:

1) J2EE application client (how a client in another VM could locate a remote bean if in JNDI I dont' write a remote ip address?)

2) EJB (how an OrderBean on hostA could locate CustomerBean on hostB if
they reside in different container -> different .ear and I can't specify an ip address in JNDI ?)

May you please help me more?
T.I.A.
[ July 29, 2005: Message edited by: marcus don ]
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to pass the environment properties, including the hostname and port of the server, into the InitialContext factory. Here is an example of the code a client needs to connect to a remote WebLogic Server.

 
marcus don
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic