How can EJBs talk to the EJBs in another j2ee server?

Hi there,

I've got two j2ee applications that are running on two different machines. In application A, some ejbs need to talk to the ejbs living in application B. But I don't know how an EJB can look up another EJB running in another computer?

When a stand-alone java app client tries to talk to remote j2ee server, we can put some options in the command line, such as "java -Dorg.omg.CORBA.ORBInitialHost=buzz" Client_A", but there's no opportunity for me to put that option in EJB container.

Does anybody experience the same problem?

Thanks for all helpful suggestions.

Rainbow

[634 byte] By [rainbowC] at [2007-9-26 12:37:50]
# 1

hi,

this is typically done using JNDI: looking up the home interface and getting a remote interface. JNDI may use RMI, CORBA or LDAP as underlying protocol.

of course, your EJBs have to be registered with JNDI. this is a task your EJB container possibly is capable of.

for details pls consult JNDI + EJB docs and tutorials like http://java.sun.com/products/jndi/tutorial/ and many others + your AppServers docs.

good luck,

b.

BFondermann at 2007-7-2 11:56:19 > top of Java-index,Other Topics,Patterns & OO Design...
# 2

Hi Rainbow,

Did you get a fix for this? I'm stuck on the same point - how to specify ORBInitialHost in a JAR or WAR deployment.

Thanks

Martin

PS BFonderman - can you be more specific?

I've tried doing

java.util.Properties properties= new java.util.Properties ();

properties.setProperty(Context.PROVIDER_URL ,"iiop://linuxpc:1050");

and alternatively

properties.setProperty("org.omg.CORBA.ORBInitialHost" , "linuxpc");

then passing properties to InitialContext(properties)

without success - my error message is

Unable to lookup home: TheConverter null

from the lookup operation

Object objRef = ic.lookup("java:comp/env/ejb/TheConverter");

JTemple0 at 2007-7-2 11:56:19 > top of Java-index,Other Topics,Patterns & OO Design...