I've got an EJB set up in my entity-layer-EAR:
<session>
<ejb-name>DoctorDaoImpl</ejb-name>
<business-local>mypath.DoctorDao</business-local>
<ejb-class>mypath.DoctorDaoImpl</ejb-class>
<session-type>Stateless</session-type>
</session>
According to the logs, the EAR and its EJBs start up fine. I have the facade (e.g. DoctorDao) in shared libs, and the entity layer EAR has the implementations (eg. DoctorDaoImpl).
Now when I deploy my Doctor service, it has a data-service.jar who's DoctorDataEjb injects DoctorDao.
But I get an error saying:
The mypath.DoctorDao EJB reference in the DoctorDataEjb component in the data-service.jar module of the Doctor application could not be resolved. nested exception is: com.ibm.ejs.container.EJBNotFoundException: EJB with interface mypath.DoctorDao not present in application Doctor
Now, I realise that indeed, the EJB is not present in the Doctor application. It is present in the entity-layer-EAR. I've seen this link which is similar, so I imagine I must just work out the correct binding-name to enter in the "EJB references" WAS Admin UI (or perhaps I can set it in ibm-ejb-jar-bnd.xml).
If I look at the generated ejb-jar_merged.xml, I see the ref defined as such:
<ejb-ref>
<ejb-ref-name>mypath.DoctorDao</ejb-ref-name>
<remote>mypath.DoctorDao</remote>
<injection-target>
<injection-target-class>mypath.DoctorDataEjb</injection-target-class>
<injection-target-name>doctorDao</injection-target-name>
</injection-target>
</ejb-ref>
I tried setting the Target Resource JNDI Name to: java:global/MyEntityLayerApp/entity-service/DoctorDaoImpl!myPath.DoctorDao and now get: java.lang.IllegalArgumentException: Can not set myPath.DoctorDao field myPath.DoctorDataEjb.doctorDao to myPath.EJSLocal0SLDoctorDaoImpl_
zoiks. Something about 'Local'.