InfoCenter Home >
6: Administer applications >
6.6: Tools and resources quick reference >
6.6.5: Administering enterprise beans (overview) >
6.6.5.1: Administering enterprise beans with the Java administrative console >
6.6.5.1.1: Configuring new enterprise beans

6.6.5.1.1: Configuring new enterprise beans

For any application server product, a procedure is required to put a developed enterprise bean onto an application server where it can be made available to users.

This section outlines the procedure for the WebSphere Application Server product, from the administrator's point of view.

  1. The enterprise bean developer writes and compiles the enterprise bean components. The developer packages the components and a deployment descriptor into an EJB JAR file containing a manifest.

    For entity beans (BMP or CMP), the developer generates the database tables the beans will use to store their data.

  2. The developer transfers the JAR file to the WebSphere administrator, or informs the administrator of its location on a machine in the WebSphere administrative domain.

    The developer tells the administrator whether the JAR file has been deployed.

    A developer using VisualAge for Java can deploy the JAR file before giving the file to the administrator. A deployed JAR file consists of the EJBHome and EJBObject classes, persistor and finder classes, and stub and skeleton files.

    Otherwise, the administrator makes a note to deploy the JAR file while installing it in the WebSphere administrative domain.

    There are special considerations for deploying entity beans with container-managed persistence (CMP) and any enterprise beans with EJB inheritance.

  3. The administrator installs the JAR file in the administrative domain, deploying the JAR file if necessary.

    Installing an enterprise bean refers to the process of placing the bean in a runtime environment comprised of an application server and enterprise bean container.

    During this step, the administrator can optionally edit the bean deployment descriptor.

  4. If the beans in the JAR file reference classes outside of the JAR file, the administrator adds the referenced classes to the CLASSPATH environment variable of the machine on which the beans are installed.

    The bean JAR file itself is automatically added to the CLASSPATH when the administrator installs the bean JAR file in the WebSphere domain. If the referenced classes are contained in the JAR file, no action is required.

  5. The administrator or developer prepares the enterprise bean for workload management (recommended).

    This step is not required for JAR files deployed in VisualAge for Java.

  6. The administrator starts the enterprise bean, perhaps after adding it to an enterprise application.

  7. After changing the enterprise bean, the developer provides a replacement JAR file to the administrator. The administrator adds the file to the WebSphere administrative domain.
    • If the administrator treats the JAR file as a new one, the administrator can install the deployed file into a running application server without having to stop the server and start it again.

      The administrator should delete the old JAR file from the WebSphere directories so that there is no chance it will be used.

    • If the administrator treats the JAR file as a replacement for an existing one, the administrator must stop the application server on which the bean is running and start it again after installing the replacement JAR file.

Special deployment considerations

Considerations for deploying entity beans with CMP

If you are using CMP entity beans that do not rely on a particular database configuration (that is, the beans are not storing data in legacy applications or in existing database tables) you can use the WebSphere Administrative Console to automatically create the deployed JAR file and the corresponding database table.

If you are using CMP entity beans for a legacy application (or the beans are from a third party vendor), you must use VisualAge for Java to create the deployed JAR file. You can then create (install) the bean by using the WebSphere Administrative Console.

It is strongly recommended that you use VisualAge for Java for deploying beans used in legacy applications or beans that require complex mappings to a database table. If you use the automatic deployment process in the console, the order and names of the columns in the generated table are not guaranteed to match the table configuration needed by the legacy application. (The console deployment process makes certain assumptions about the order of container-managed fields.)

If you decide to use automatic deployment within the console, but want to manually create the database table, note the following:

  • The name of the database table must follow the convention EJB.beannameBeanTbl. There is a 14-character limit on the length of table names in DB2.

  • The primary key fields must appear first, and the column headings in the database must match the name and order of the fields as they appear in the deployment descriptor.

An entity bean with CMP must be associated with the name of a data source. A data source specifies a database name, Uniform Resource Locator (URL), network protocol, and location in the Java Naming and Directory Interface (JNDI) namespace.

A data source also references a JDBC driver, used to locate the driver's JAR file on the node. When you create the bean, you are prompted to supply the name of this data source.

Considerations for deploying JAR files with EJB inheritance

Consider the following when deploying JAR files with EJB inheritance:

  • Enterprise beans that participate in an inheritance hierarchy must be deployed in a single JAR file, and you must install and uninstall the inheritance hierarchy as a unit.

  • You must modify the JNDI name of the home for each enterprise bean within the hierarchy. The JNDI name of each bean in the hierarchy must be unique within its container.

Go to previous article: Administering enterprise beans with the Java administrative console Go to next article: Property files pertaining to enterprise beans

 

 
Go to previous article: Administering enterprise beans with the Java administrative console Go to next article: Property files pertaining to enterprise beans