users@glassfish.java.net

InititialContext lookup hangs

From: <glassfish_at_javadesktop.org>
Date: Thu, 02 Jul 2009 00:54:39 PDT

Hi, I'm migrating an application from JBoss to glassfish. Part of the application are backend EJB's.

E.G
@Stateless(name="Users", mappedName="UsersBean")
public class UsersBean implements UsersRemote {
........
}

Which I get access using JNDI Credentials
java.naming.factory.initial = com.sun.enterprise.naming.SerialInitContextFactory
java.naming.factory.url.pkgs = com.sun.enterprise.naming
java.naming.factory.state = com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl
org.omg.CORBA.ORBInitialHost = localhost
org.omg.CORBA.ORBInitialPort = 3700

The code I use to get an EJB via JNDI lookup is
            InitialContext ctx = new InitialContext("my jndi properties");
            Object ret = ctx.lookup("UsersBean");

This is fine on initial Glassfish startup. However anytime I shutdown glassfish and attempt to restart, the "ctx.lookup(name);" call gets stuck and hangs, until eventually start up timeouts. It seems to be some kind of dead lock issue in Glassfish, as the same code worked fine on Weblogic/JBoss when I used their specific Context Factory implementations.

Has anyone faced/overcame this issue ?
Are there any other Context Factory classes I can use which don't face this issue ?
[Message sent by forum member 'colin_hanley' (colin_hanley)]

http://forums.java.net/jive/thread.jspa?messageID=353877