Monday, December 04, 2006

Cannot Locate Remote EJB From Servlet

Hi,

since two days I fight with glassfish. I've opened an issue:
https://glassfish.dev.java.net/issues/show_bug.cgi?id=1643

What I try to do sounds very simple and is working like a charm from standalone clients.

1.) Initialize InitialContext

InitialContext ic = null;
Properties props = new Properties();
props.setProperty(Context.INITIAL_CONTEXT_FACTORY, "com.sun.enterprise.naming.SerialInitContextFactory");
props.setProperty(Context.URL_PKG_PREFIXES, "com.sun.enterprise.naming");
props.setProperty(Context.STATE_FACTORIES, "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
props.setProperty("com.sun.appserv.iiop.endpoints","10.10.1.212:11237"); //env.put("com.sun.appserv.iiop.endpoints","host1:port1,host2:port2,...");
props.setProperty("org.omg.CORBA.ORBInitialHost", "devasws056.proemion.com");
props.setProperty("org.omg.CORBA.ORBInitialPort", "11237");
ic = new InitialContext(props);


2.) Locate EJB (3.0)
Object o = (MyBeanRemote) ic.lookup("com.ejbs.MyBeanRemote");


Where the standalone client works as expected I have difficulties in locating the ejb from a servlet. EJB and Servlet reside in different applications (different ear files) but are deployed on the appserver instance.

Currently I still get a NameNotFoundException on the server. I hope that I will find a solution soon. Luckily some people are trying to help me already. The glassfish team/community is very responsive.

I will inform you as soon as I have found a solution.

Labels:

0 Comments:

Post a Comment

<< Home