I’m having problems using a Local Session EJB deployed to the Sun Application Server. Specifically, when I attempt to do a JNDI lookup of the bean, I get the error:
No object bound to name java:comp/env/ejb/admin/quicktravelsystem/Login
The relevent entries in my sun-ejb-jar.xml file are:
<ejb>
<ejb-name>Login</ejb-name>
<jndi-name>ejb/admin/quicktravelsystem/Login</jndi-name>
</ejb>
The relevant entries in my ejb-jar.xml are:
<session >
<description><![CDATA[Description for Login]]></description>
<display-name>Name for Login</display-name>
<ejb-name>Login</ejb-name>
<local-home>quicktravelsystem.admin.interfaces.LoginLocalHome</local-home>
<local>quicktravelsystem.admin.interfaces.LoginLocal</local>
<ejb-class>quicktravelsystem.admin.ejb.LoginSession</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
I have tried the following call ways of looking up the bean, all without luck (each prefaced with Context ctx = new InitialContext();):
LoginLocalHome loginLocalHome = (LoginLocalHome) ctx.lookup(“java:comp/ejb/admin/quicktravelsystem/Login”);
LoginLocalHome loginLocalHome = (LoginLocalHome) ctx.lookup(“java:comp/env/ejb/admin/quicktravelsystem/Login”);
LoginLocalHome loginLocalHome = (LoginLocalHome) ctx.lookup(“java:comp/env/ejb/Login”);
LoginLocalHome loginLocalHome = (LoginLocalHome) ctx.lookup(“Login”);
I suspect that the poblem is context related (I have also tried obtaining the context from the System.getContext() call, but that resulted in security problems). Is the problem a lack of definition of some property in the sunone ejbdoclet for the EJB project (EJB project | Properties | MyEclipse-XDoclet)? The tutorial was clear about the necessary inclusions for jboss, but not for other app servers (such as Sun’s).
Thanks in advance!