Forums Register Login
How do an application client to access remote EJB ?
I have an EJB called "RemoteEJB1Bean" deployed on
Server is Sun Application Java Server 9.1 with Java EE 5

I write an application client on like this

public static void main(String[] args) throws Exception {
InitialContext ic=new InitialContext();
RemoteEJB1Remote my=(RemoteEJB1Remote)ic.lookup("RemoteEJB1Bean");
It works well.

BUT I want to write an application client on DIFFERENT HOST using iiop, exception occured, here is my code :

public static void main(String[] args) throws Exception {
Properties props1 = new Properties();
props1.setProperty("java.naming.factory.initial", "com.sun.enterprise.naming.SerialInitContextFactory");
props1.setProperty("java.naming.factory.url.pkgs", "com.sun.enterprise.naming");
props1.setProperty("java.naming.factory.state", "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
props1.setProperty("org.omg.CORBA.ORBInitialHost", "");
props1.setProperty("org.omg.CORBA.ORBInitialPort", "3700");
InitialContext ic = new InitialContext(props1);

exception is :
javax.naming.NameNotFoundException: RemoteEJB1Bean not found

What should I do ?
[ February 02, 2008: Message edited by: mojo lai ]

This thread has been viewed 454 times.

All times above are in ranch (not your local) time.
The current ranch time is
Oct 22, 2018 05:52:21.