Skip to main content

Failed to lookup EJB deployed in server instance named instance1

2 replies [Last post]
Joined: 2012-09-21

I have deployed an EJB in a server instance named instance1 which is not the Domain Admin Server. When I tried to lookup this EJB with client code,

Properties p = new Properties();
p.setProperty("java.naming.factory.initial", "com.sun.enterprise.naming.SerialInitContextFactory");
p.setProperty("java.naming.factory.url.pkgs", "com.sun.enterprise.naming");
p.setProperty("java.naming.factory.state", "");
p.setProperty("org.omg.CORBA.ORBInitialHost", "localhost");
p.setProperty("org.omg.CORBA.ORBInitialPort", "3700");
Context context = new InitialContext(p);
TestBInterface obj = (TestBInterface)context.lookup("TestBBean");

I have NamingNotFoundException.

But when I deployed the same EJB to DAS, the code above succeed to find EJB instance. How can I lookup EJB in server instance which is not DAS?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2006-10-06

3700 is the default ORB port for DAS. Change following to match up with the ORB port for instance1.

p.setProperty("org.omg.CORBA.ORBInitialPort", INST1_ORB_PORT);

Joined: 2012-09-21

It's port reason ...