Hi there, I am a beginner with EJBs and I have a question on how to reference an existing
EJB running on Websphere from another web application.
I started off with an EJB project containing a stateless session bean that performs a lookup to an oracle database. I then generated an EJB client jar project, which in my understanding, splits out the local and home classes along with any required DTOs. I guessed that any application that needed to access my EJB would need this client JAR.
I've now written a web application that uses the EJB app - if I deploy both the EJB and web app in the same EAR, it works fine.
However, if I create a separate EAR for the web project that also contains the EJB client JAR code (but not the EJB app itself), I get a noclassdef exception for the local ejb classes, despite the EJB client jar being present. I've also ensured that the local EJB is defined in the web deployment descriptor as follows:
<ejb-local-ref id="EJBLocalRef_1128420642844">
<ejb-ref-name>CHIPSearchEJB</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>uk.gov.dh.portal.components.business.search.chip.ejb.CHIPSearchLocalHome</local-home>
<local>uk.gov.dh.portal.components.business.search.chip.ejb.CHIPSearchLocal</local>
<ejb-link>CHIPSearch_EJB.jar#CHIPSearch</ejb-link>
</ejb-local-ref>
Ultimately my EJB app has to be referenced by another application running on an entirely different server, so I need to understand how all this fits together. Do I just need the EJB client JAR and the correct JNDI lookup?
If anyone could shed any light on this, I'd be very grateful - sorry if these questions are basic or have been asked before.
Marc