Java EJB Introduction to EJBs: Part 4

Introduction to EJBs: Part 4

This is the fourth of four installments that make up Chapter 4: Introduction to EJBs from the book Sams Teach Yourself J2EE in 21 Days (ISBN:0-672-32384-2) written by Martin Bond, Dan Haywood, Debbie Law, Andy Longshaw, and Peter Roxburgh, published by Sams Publishing.

Deploying and Using an EJB in the J2EE Reference

You should now be in a position to write and test an EJB client. However,
before you can do that, you must deploy an EJB that it can use. In this section,
you will look at how to deploy an EJB in the J2EE Reference Implementation (RI)
and how to then use it from a simple client.

The J2EE on which your EJB is deployed will provide a complete server-side
environment. It houses any EJBs, runs a Web Server for JSP/servlets, runs a
naming server for storing component location information, and provides database
access. All J2EE- compliant application servers will do this—even a
non-commercial version, such as the J2EE RI. The RI also provides you with a
ready-to-use database so you do not have to concern yourself with hooking up to
an existing database or installing a separate one.

To deploy and test your EJBs (and servlets/JSPs later), you only need a
single machine. Both the J2EE client and the J2EE server (and its EJBs, servlets
and JSPs) can run on the same machine. No connection to the Internet is
required. The J2EE RI is available on multiple platforms (Win32, Solaris, and
Linux) and should be consistent across these platforms, so that J2EE
applications created on one platform can be deployed on another.

If you encounter problems at any stage, try referring to the troubleshooting
section just before today's Summary.

Latest Posts

Related Stories