Folks,
I am getting ever more confused about how to lookup JNDI references.
Take a simple stateless SessionBean being looked up from SOAP service. The
SOAP service is invoked from the emebedded Tomcat via Apache SOAP 2.2:
The ejb-jar.xml contains:
<ejb-jar>
<display-name>OrganisationListEJB</display-name>
<enterprise-beans>
<session>
<display-name>OrganisationListEJB</display-name>
<ejb-name>OrganisationListBean</ejb-name>
<home>uk.co.landmark.contactmanager.server.organisation.ejb.OrganisationList
Home</home>
<remote>uk.co.landmark.contactmanager.server.organisation.ejb.OrganisationLi
st</remote>
<ejb-class>uk.co.landmark.contactmanager.server.organisation.ejb.Organisatio
nListBean</ejb-class>
etc....
</ejb-jar>
The jboss.xml file contains:
jboss>
<enterprise-beans>
<ejb>
<ejb-name>OrganisationListBean</ejb-name>
<jndi-name>ejb/organisation/OrganisationList</jndi-name>
</ejb>
</enterprise-beans>
</jboss>
My understanding is that the "OrganisationListBean" is bound to a JNDI name
of "ejb/organisation/OrganisationList"
If one looks it up from outside the EJB container one should use
"ejb/organisation/OrganisationList", whereas from within the EJB container
one should use "java:comp/env/ejb/organisation/OrganisationList"
Is this correct?
When the soap service looks up the bean, the code is:
initialContext.lookup("ejb/organisation/OrganisationList");
When running the code, the following is displayed in the jboss window:
[] looking up Home interface ejb/organisation/OrganisationList
[] Failed to find Home interface
javax.naming.NameNotFoundException: ejb not bound
at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteC
all.java:245)
at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:349)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:333)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at
uk.co.landmark.contactmanager.server.common.soapservice.SoapService.initHome
InterfaceRefe
rence(SoapService.java:131)
(The "[]" are my log4j debug statements.)
The JNDIView output is:
Application:
file:/J:/JBoss-2.2.2_Tomcat-3.2.2/jboss/tmp/deploy/Default/ContactManager.ea
r/
java:comp namespace of the OrganisationListBean bean:
+- env (class: org.jnp.interfaces.NamingContext)
| +- ejb (class: org.jnp.interfaces.NamingContext)
| | +- organisation (class: org.jnp.interfaces.NamingContext)
| | | +- OrganisationDAOClass (class: java.lang.String)
So, can anyone shed any light on what is going wrong here?
I am not a JNDI expert, and I am close to tears with this one :-)
Thanks humungously....
Adam
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user