Moving to Enterprise JavaBeans 183
• WebSphere Application Server Libraries
• Sun JSDK Class Libraries
Notice at this point that you have some errors in the tea.business.cb package
because you do not have any of the Component Broker libraries loaded. We
have been unable to find any successful method of having the EJB and
Component Broker libraries coexist in VisualAge for Java. This is sure to
change as they are derived from the same code base. However, in the
versions that we used, they were incompatible.
There are also errors in several other TEA packages because of some
missing WebSphere function. To get around that, we will just import the
missing packages and classes from WebSphere into the IBM EJB Runtime
Support project. Copy the following packages and classes from the
WebSphere implementation into the IBM EJB Runtime Support project:
• com.ibm.jbroker package
• com.ibm.jbroker.ejb package
• com.ibm.CosNaming.TransientNameService class
If you are unsure of how to copy the packages and classes, consult the
VisualAge for Java help, or import Version 1.3 of the IBM EJB Runtime
Support from the repository supplied with the sg245276.zip file.
17.2 Changing the Existing Application
This time, to introduce the use of EJBs, we are going to change the
application by replacing the EmployeeID Component Broker object developed
in Chapter 16, “WebSphere and Component Broker Interoperability” on page
173 with an equivalent EJB. This EJB provides the exact same functionality. It
just covers our purpose of showing how to integrate EJBs in our application.
Among the different possible EJBs, we choose to implement a bean-managed
persistence bean.
17.3 Creating an EJB
Follow these steps to create an EJB:
1. Write a remote interface.
2. Write a home interface.
3. Write a bean.
4. Write a bean key.