19.5. Developing an EJB Client
With the bean created and deployed, we need a client in order to test it. Normally, a sophisticated EJB component such as the one we've developed would deserve a nice, meaty client like a JSP/servlet combination. But to keep the code size simple and not introduce any extraneous features, we'll actually go back to our very first example client-the Console class—and modify it to work with our Enterprise JavaBean.
The main difference is in gaining access to the Standings EJB. In the original client, we obtained a reference from the ObjectFactory. For the EJB client, we instead need to look up the bean in the JNDI service.
When we've looked up objects previously in the JNDI or RMI registries, we've simply used the Java ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access