BEA Logo BEA WebLogic Enterprise Release 5.0

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   WLE Doc Home   |   J2EE & Related Topics   |   Previous   |   Next   |   Contents   |   Index

Using the WebLogic EJB Deployer

This section describes how to use the WebLogic EJB Deployer to configure and deploy Enterprise JavaBeans (EJBs) to use with your WebLogic Enterprise server. It contains the following topics:

For more information about deploying EJBs in the WLE environment, see Building and Deploying Enterprise JavaBeans (EJBs).

Navigating the WebLogic EJB Deployer

This section describes how to navigate the WebLogic EJB Deployer. It contains the following topics:

Starting the WebLogic EJB Deployer

This topic describes how to start the WebLogic EJB Deployer in the Unix or Windows environment.

Setting the CLASSPATH

Before you start the WebLogic EJB Deployer, make sure that the CLASSPATH contains the WebLogic classes (M3.jar and weblogicaux.jar ), the jar file you want to open, and any others classes used by your EJBs. Listing 2-1 provides an example (on Windows NT) in which the first two command lines show user-specific settings and the final command line shows setting the CLASSPATH .

Listing 2-1 Setting the CLASSPATH Before Starting the WebLogic EJB Deployer


set TUXDIR=D:\bea_prod\wledir
set WLECP=%TUXDIR%\udataobj\java\jdk
set CLASSPATH=%WLECP%\M3.jar;%WLECP%\weblogicaux.jar;jarfilepath;%CLASSPATH%

where jarfilepath is the path to the JAR file you want to open.

Running the Startup Command

To start the WebLogic EJB Deployer:

$ java weblogic.EJBDeployWizard options

where options are:

Option

Description

-help

Prints help text.

-laf [basic | metal | motif | win]

Sets the look and feel of the editor. Defaults to system-native.

The main screen appears. Figure 2-1 shows an example of the Main Screen (with an opened ejb-jar file).

Figure 2-1 Main Screen

Navigating Menus

The WebLogic EJB Deployer contains the following menus:

File menu

The File menu contains the following commands:

Command

Description

Open

Opening ejb-jar Files

Save

Saving Changes to ejb-jar Files

Save As

Saving the Current ejb-jar File to a New Name

Save All

Saving Changes to ejb-jar Files

Close

Closing ejb-jar Files

Close All

Closing ejb-jar Files

Exit

Exiting the WebLogic EJB Deployer

Edit menu

The Edit menu contains the following commands:

Command

Description

Deploy

Deploying ejb-jar Files

Options

Configuring the WebLogic EJB Deployer

Help menu

The Help menu contains the following commands:

Command

Description

Using

Displays Help

About

Displays the splash screen

Using the Toolbar

Figure 2-3 shows the toolbar.

Figure 2-2 Toolbar

The Toolbar contains the following command buttons:

Button

Name

Description

Open

Opening ejb-jar Files

Save

Saving Changes to ejb-jar Files

Save As

Saving the Current ejb-jar File to a New Name

Save All

Saving Changes to ejb-jar Files

Close

Closing ejb-jar Files

Close All

Closing ejb-jar Files

Deploy

Deploying ejb-jar Files

To run a command, click the associated command button.

Configuring the WebLogic EJB Deployer

You can configure environment and ejbc settings for the WebLogic EJB Deployer.

Configuring Environment Settings

To configure the environment settings for the WebLogic EJB Deployer:

  1. Click the Options button on the toolbar, or choose Options from the Edit menu.

    The WebLogic EJB Deployer Properties dialog box appears. Figure 2-3 shows an example of the WebLogic EJB Deployer Properties dialog box.

    Figure 2-3 WebLogic EJB Deployer Properties Dialog Box

  2. Double-click the plus (+) sign to the left of the deployer.

  3. Click Environment.

    The Environment Properties pane appears. Figure 2-4 shows an example of the Environment Properties pane.

    Figure 2-4 Environment Properties

    The Environment Properties pane contains the following options:

    Name

    Description

    saveWindowLocations

    Determines whether the WebLogic EJB Deployer saves window attributes (true, the default), or not (false)

    tmpdir

    Specifies the temporary directory for saving window attributes (default is \tmp ).

  4. Make the changes you want, if any, and then click OK.

Configuring EJBC Settings

You can configure the settings that the BEA ejbc compiler uses when it generates container classes. To configure these settings:

  1. Click the Options button on the toolbar, or choose Options from the Edit menu.

    The WebLogic EJB Deployer Properties dialog box appears. Figure 2-5 shows an example of the WebLogic EJB Deployer Properties dialog box.

    Figure 2-5 WebLogic EJB Deployer Properties Dialog Box

  2. Double-click the plus (+) sign to the left of the deployer.

  3. Click ejbc.

    The EJBC Properties pane appears. Figure 2-6 shows an example of the EJBC Properties pane.

    Figure 2-6 EJBC Properties

    The EJBC Properties dialog box contains the following options:

    Name

    Description

    keepgenerated

    If True is selected, ejbc saves the generated Java files for deployment in the ejb-jar file. If False is selected, ejbc performs a compliance check but does not update the ejb-jar file.

    compiler

    Specifies the Java compiler to use for generating container classes.

  4. Make the changes you want, if any.

  5. Click OK.

For more information about the ejbc compiler, see the Command Reference.

Exiting the WebLogic EJB Deployer

To exit the WebLogic EJB Deployer:

  1. Choose Exit from the File menu.

    If the WebLogic EJB Deployer detects that changes to any open ejb-jar files have not been saved, it prompts you whether to save it (Yes) or not (No). Figure 2-7 shows an example of the Save prompt.

    Figure 2-7 Save Prompt

  2. Click Yes or No as appropriate.

EJB Deployment Tasks

This section describes the following EJB deployment tasks.

Summary of Deployment Steps

Deploying an EJB involves the following basic steps:

  1. Create the standard deployment descriptor and optionally, the extended deployment descriptor. The Bean Provider is responsible for creating these files separately. The WebLogic EJB Deployer then uses these files to create deployable ejb-jar files.

  2. Start the WebLogic EJB Deployer.

  3. Load an ejb-jar file.

  4. Optionally, change settings in the deployment descriptor.

  5. Deploy the ejb-jar file, which generates the container classes, adds the container classes to the ejb-jar file, and saves any changes.

  6. Close the ejb-jar file.

  7. Copy the ejb-jar file to a target Java server.

  8. Update the UBBCONFIG with the name and location of this ejb-jar file.

You can also use WebLogic EJB Deployer to simply view the settings in the ejb-jar file's deployment descriptor.

Opening ejb-jar Files

To open an ejb-jar file:

  1. Click the Open button on the toolbar, or choose Open from the File menu.

    The Open EJB-JAR File dialog box appears. Figure 2-8 shows an example of the Open EJB-JAR File dialog box.

    Figure 2-8 Open EJB-JAR File Dialog Box

    The Open EJB-JAR File dialog box contains the following options:

    Name

    Description

    Look In

    Selects a directory.

    Directory List

    Displays a list of directories and files in the selected directory.

    File Name

    Type or double-click the name of the ejb-jar file you want to open.

    File of Type

    Select a file type.

  2. Select the source directory that contains the ejb-jar file that you want to open.

  3. Select or type the name of the ejb-jar file you want to open.

  4. Click Open.

The WebLogic EJB Deployer opens the ejb-jar file, validates its contents, and displays it.

Navigating the ejb-jar Contents List

The ejb-jar Contents List displays all the elements of the selected ejb-jar file in a tree hierarchy.

You can expand or collapse a list in order to show or hide subordinate items in the hierarchy. A plus (+ ) or minus (- ) sign to the left of an entry indicates whether an item contains subordinate (child) items. To show or hide a subordinate item, click the parent name.

Navigating a Deployment Descriptor

To navigate properties in a deployment descriptor (both standard and optional extended XML elements), click its corresponding entry in the ejb-jar Contents List. The panel associated with the entry appears in the frame to the right.

Table 2-1 lists the panels in the WebLogic EJB Deployer.

Table 2-1 Panels in the WebLogic EJB Deployer  

Panel Name

Description

ejb-jar panel

Displays information about the ejb-jar file, including the following tabs:

Bean Properties Panel

Displays a list of EJBs associated with the selected ejb-jar file, including the name and type of each EJB.

EJB panel

For the selected EJB, displays the bean class, home interface, remote interface, a summary of bean characteristics, and a description.

Method panel

For the selected method, displays the transaction attribute, a list of allowed callers, and a description.

Persistence panel

For the selected EJB, displays persistence information: the primary key class, a list of container-managed fields, and a description.

Security Role References panel

For the selected EJB, displays the security role reference and link to a security role.

Environment Entries panel

For the selected EJB, displays the name, type, value, and a description of one or more environment entries.

EJB Reference panel

For the selected EJB, displays the home interface, remote interface, and a description of the EJB reference.

Resource Factory Reference panel

For the selected EJB, displays the type, sign-on responsibility, JNDI reference link, and a description of the resource factory reference.

JDBC panel

For the selected EJB with container-managed persistence, displays the following tabs:

File panel

For the selected stateful session bean with container-managed persistence, displays the root directory for persistent storage.

Changing Deployment Descriptor Properties

Sun Microsystem's Enterprise JavaBeans Specification 1.1 defines which EJB Role is responsible for maintaining each attribute in the deployment descriptor. The WebLogic EJB Deployer allows you to change only the standard information that Deployers are authorized to change, in addition to certain WLE XML extension elements.

Table 2-2 lists the information that you can change using the WebLogic EJB Deployer.

Table 2-2 Editable Information in the WebLogic EJB Deployer  

Name

Panel

XML Element

Transaction Attribute

Method panel

trans-attribute

Application Role

Security Role References panel

role-link

Value

Environment Entries panel

env-entry-value

Table name

Configuration tab on the JDBC panel

table-name

Connection Pool Name

Configuration tab on the JDBC panel

pool-name

Table column

Field-Column Map tab on the JDBC panel

table-column-name

Expression

Finders tab on the JDBC panel

query-grammar

Module Initialization Class

Module Initialization tab

module-initializer-class

Persistent directory root

File panel

persistence-store-directory-root

Note: If you change a property value, the WebLogic EJB Deployer validates the value when you change focus. If the change fails the validation test, the WebLogic EJB Deployer displays a message in the Errors tab and displays the bean in a red font. The WebLogic EJB Deployer will not allow you to save any changes or deploy the EJB until you have fixed the problem.

Saving Changes to ejb-jar Files

This section includes the following topics:

Saving the Current ejb-jar File

To save changes to the ejb-jar file in the current window:

Saving All Open ejb-jar Files

To save changes to all open ejb-jar files:

Saving the Current ejb-jar File to a New Name

To save an ejb-jar file to a different name:

  1. Click the Save As button on the toolbar, or choose Save As from the File menu.

    The Save As dialog box appears. Figure 2-9 shows an example of the Save As dialog box.

    Figure 2-9 Save As Dialog Box

    The Save ejb-jar File As dialog box contains the following options:

    Name

    Description

    Look In

    Selects a directory.

    Directory List

    Displays a list of directories and files in the selected directory.

    File Name

    Specifies the file name.

    File of Type

    Selects a file type.

  2. Select a target directory.

  3. Type or select a different name for the target ejb-jar file.

  4. Click Save.

    If the WebLogic EJB Deployer detects any errors in the ejb-jar file, it displays a message in the Errors tab. You must fix the problem before saving the file.

Deploying ejb-jar Files

To deploy an ejb-jar file:

  1. Click the Deploy button on the toolbar, or choose Deploy from the Edit menu.

    The Generate container classes dialog box appears. Figure 2-10 shows an example of the Generate container classes dialog box.

    Figure 2-10 Generate Container Classes Dialog Box

  2. For each EJB, enter the name for the EJB home that is registered in the Global WLE JNDI namespace.

    This name corresponds to the jndi-name element, which is a WLE XML extension to the deployment descriptor.

    To allow Java clients to perform a lookup on the JNDI name for the EJB home and gain access to the object, the name of the EJB home must be registered in the Global WLE JNDI namespace. The JNDI name must be unique among all global factory names in a WLE domain, including EJB homes, CORBA factories, and RMI named objects.

  3. Click Deploy.

    The WebLogic EJB Deployer saves changes to the ejb-jar file automatically.

    Next, the WebLogic EJB Deployer generates the container classes for the ejb-jar file, displaying a message dialog box to indicate progress and displaying status messages in the Messages tab. Figure 2-11 shows an example of the message dialog box.

    Figure 2-11 Message Dialog Box for Generating Container Classes

    To interrupt this process, click Cancel.

Closing ejb-jar Files

This section includes the following topics:

Closing the Current ejb-jar File

To close the ejb-jar file in the current window:

  1. Click the Close button on the toolbar, or choose Close from the File menu.

    If the WebLogic EJB Deployer detects that changes have not been saved to the current ejb-jar file, it prompts you whether to save it (Yes) or not (No). Figure 2-12 shows an example of the Save prompt.

    Figure 2-12 Save Prompt

  2. Click Yes or No as appropriate.

Closing All Open ejb-jar Files

To close all open ejb-jar files:

  1. Click the Close All button on the toolbar, or choose Close All from the File menu.

  2. If the WebLogic EJB Deployer detects that changes to any open ejb-jar files have not been saved, it prompts you whether to save it (Yes) or not (No). Figure 2-13 shows an example of the Save prompt.

    Figure 2-13 Save Prompt

  3. Click Yes or No as appropriate.

Clearing Messages

To clear messages from the Messages or Errors tab:

  1. Right-click the mouse anywhere in the Messages or Errors tab.

  2. Click the Clear Messages button.

    The WebLogic EJB Deployer clears the text.

    Note: When you open a new ejb-jar file, the WebLogic EJB Deployer clears the message text automatically.