Java Reference
In-Depth Information
ejb:<app-name>/<module-name>/<distinct-name>/
<bean-name>!<fully-qualified-classname-of-the-remote-interface>?stateful
And here's the corresponding binding for the TheatreBookerBean class:
ejb:/
ticket-agency-ejb//TheatreBookerBean!com.packtpub.as7development.chapter3.ejb.TheatreBooker?stateful
Note
If you pay attention to the server logs, you will see that once your application is
deployed, a set of JNDI bindings will be displayed on the server console. For ex-
ample:
java:global/ticket-agency-ejb/
TheatreInfoBean!com.packtpub.as7development.chapter3.ejb.TheatreInfo
java:app/ticket-agency-ejb/
TheatreInfoBean!com.packtpub.as7development.chapter3.ejb.TheatreInfo
java:jboss/exported/ticket-agency-ejb/
TheatreInfoBean!com.packtpub.as7development.chapter3.ejb.TheatreInfo
Some of these bindings reflect the standard bindings as per Java EE specifica-
tions plus JBoss custom bindings ( java:/jboss ). This information, as it is, is
not relevant for us but can be used to build our EJB client lookup string by re-
placing the Java EE (or JBoss-specific prefix) with ejb:/ . For example, replace
java:/global with ejb: , and you will save yourself the headache of referring
to the EJB lookup string.
Once we have done with coding the JNDI binding string, we will code our EJB client.
The best strategy to achieve this is by creating a separate Maven project for our EJB
client so we don't need to pollute the server project with specific client dependencies.
As shown for ticket-agency-ejb , create a new Maven project from the menu
( File | New | Maven Project ) and, in the next screen, enable the archetype selection.
Search WWH ::




Custom Search