BEA Logo BEA WebLogic Server Release 1.1

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

   BEA WebLogic Server Enterprise JavaBeans:   Previous topic   |   Next topic   |   Contents   

 

Deploying EJBs with DeployerTool

 

Overview

WebLogic Server deployment files

Roles and responsibilities

Deployer projects

Developer projects

Requirements

.jar file

WebLogic Servers

Getting started

DeployerTool basics

Menu bar

Tool bar

Object panel

Top-level categories

Edit panel

Message panel

Starting DeployerTool

Setting up DeployerTool servers and preferences

Editing WebLogic Server connections

Changing DeployerTool preferences

Working with EJB deployment units

Loading a .jar file

Viewing the contents of a .jar

Setting .jar file display properties

Creating a new .jar file

Configuring basic EJB properties

Setting EJB class properties

Setting method transaction attributes

Assigning method permissions

Default method permissions in WebLogic Server

Changing method permissions

Adding, removing, and changing environment entries

Configuring WebLogic Server deployment properties

Setting cache and performance properties

Setting clustering properties

Mapping EJB references

Mapping application roles to WebLogic Server principals

Mapping EJB references

Mapping resource factory references

Configuring persistence properties for entity EJBs

Configuring container-managed fields

Configuring WebLogic Server RDBMS-based persistence

Specifying the table and connection for RDBMS operations

Mapping container-managed fields to database columns

Editing EJB finder method expressions

Validating deployment units

Validating deployment properties

Checking for compliance with EJB 1.1

Compiling and deploying EJBs

Compiling EJB container classes

Deploying .jar files to WebLogic Server

Overview

The WebLogic Server DeployerTool provides a graphical interface that Application Assemblers can use to deploy EJBs to one or more WebLogic Servers. DeployerTool simplifies the process of configuring EJB deployment properties and mapping EJB references to actual resource factories, roles and other EJBs available on a server.

DeployerTool provides many services related to EJB deployment. You can use it to:

For general information about deploying EJBs on WebLogic Server, or for information on using hot deployment features, see Deploying EJBs in WebLogic Server.

WebLogic Server deployment files

When you modify deployment properties with DeployerTool, the utility updates and saves information in the XML deployment files, ensuring that the XML is correct for its associated DTD. DeployerTool can modify certain properties in ejb-jar.xml. It can also create the weblogic-ejb-jar.xml and weblogic-cmp-rdbms-jar.xml files if they are not available in the .jar.

weblogic-ejb-jar.xml contains properties that define the caching, clustering, and performance behavior of EJBs. It also contains properties that map available WebLogic Server resources to EJBs. WebLogic Server resources include security role names, data sources such as JDBC pools and JMS connection factories, other deployed EJBs, and container-managed persistence services available in the server.

Properties in weblogic-ejb-jar.xml are linked to EJB names in ejb-jar.xml, resource names in a running WebLogic Server, and to persistence type data defined in weblogic-cmp-rdbms-jar.xml (for entity EJBs using RDBMS persistence). This figure shows the relationship among these components:

See XML deployment properties if you want to edit the XML deployment files manually, outside of the DeployerTool utility.

Roles and responsibilities

DeployerTool is designed primarily for:

To satisfy the requirements of these roles, DeployerTool provides complete controls for managing multiple EJB .jar files and WebLogic Servers, and for configuring WebLogic Server deployment properties and resources. Roles are designated by two primary types of DeployerTool projects: deployer projects and developer projects.

Deployer projects

Deployer projects enable EJB deployers and application assemblers to configure EJB deployment properties and deploy EJB .jar files to WebLogic Server. Using deployer, you can automatically create the required weblogic-ejb-jar.xml file with valid deployment properties, and you can attach EJB and resource factory references to actual resources in a running server. Deployer projects enable you to work with EJB .jar files without knowing the details of the EJB code.

If you open a .jar file and find that you cannot edit all of the deployment parameters you want to, try opening the file as a developer project.

Developer projects

Developer projects provide all the capabilities of a deployer project. Developer projects also enable you to modify EJB deployment properties that may require some knowledge of the EJB implementation code.

Note: Although a developer project enables you to configure some basic properties defined in the ejb-jar.xml deployment file, it is the responsibility of the Bean Provider to create this file and package it with the compiled EJB classes and interfaces. WebLogic Server provides the DDConverter utility to generate an ejb-jar.xml file from an existing WebLogic Server-compatible text descriptor. See Upgrading EJBs to WebLogic Server Version 5.1 for more information.

Requirements

To use DeployerTool, you must have:

.jar file

An EJB deployment unit in DeployerTool consists of a Java archive (.jar) file. The .jar file must contain all of the compiled classes for your EJB home interface, remote interface, and implementation class. It must also have a META-INF subdirectory that contains, at minimum, a valid ejb-jar.xml deployment file. The .jar file may contain classes and deployment descriptors for one or more distinct EJBs.

Note: You do not need to include a MANIFEST file in the .jar file, as was required with the EJB 1.0 specification. See the JavaSoft EJB 1.1 specification for more information.

Optionally, the .jar file can contain the weblogic-ejb-jar.xml and weblogic-cmp-rdbms-jar.xml files, which define deployment properties for WebLogic Server and WebLogic RDBMS-based persistence services. If the .jar does not contain these files, DeployerTool creates them as necessary during the deployment process.

The following shows the contents of a simple .jar file that can be loaded into DeployerTool:

$ jar tf ejb_basic_beanManaged.jar

META-INF/

META-INF/MANIFEST.MF

examples/ejb/basic/beanManaged/

examples/ejb/basic/beanManaged/Account.class

examples/ejb/basic/beanManaged/AccountBean.class

examples/ejb/basic/beanManaged/AccountHome.class

examples/ejb/basic/beanManaged/AccountPK.class

examples/ejb/basic/beanManaged/ProcessingErrorException.class

META-INF/ejb-jar.xml

META-INF/weblogic-ejb-jar.xml

Note: Classes in the .jar file must reside in directories that match their Java package hierarchy. See Step 2: Package EJB Classes and Interfaces in Upgrading EJBs to WebLogic Server Version 5.1 for more information.

WebLogic Servers

DeployerTool connects to one or more servers during the deployment process, enabling you to map references in the deployment description files to actual WebLogic Server resources.

For each WebLogic Server you want to use, make sure you have:

Getting started

To begin using DeployerTool:

  1. Read DeployerTool basics to learn how to work with the DeployerTool user interface.

  2. Start DeployerTool using the instructions in Starting DeployerTool

  3. Set up a new WebLogic Server profile using the instructions in Setting up DeployerTool servers and preferences.

  4. Load the .jar file you want to deploy using the instructions in Working with EJB deployment units.

  5. Read additional sections as necessary for:

  6. Deploy the .jar file to WebLogic Server using the instructions in Compiling and deploying EJBs.

DeployerTool basics

The DeployerTool program window is divided into the following main components:

The figure below illustrates these components:

Menu bar

The menu bar contains several menus for:

Tool bar

Icons in the tool bar provide quick access to selected DeployerTool menu options. Hold your cursor over an individual icon to learn its function.

Object panel

The object panel provides a hierarchical view of the .jar files, EJBs, and EJB properties you have opened. Clicking the + symbol next to an object expands the object, listing the nested objects or properties it contains. Clicking the - symbol collapses the object, hiding its nested properties.

Clicking directly on an object or property name displays its details and editable fields in the edit panel, described below.

Top-level categories

The top-level categories in the object panel represent DeployerTool Projects and Servers. DeployerTool Projects can contain Deployer projects or Developer projects. Developer projects allow you to configure properties that require some knowledge of the EJB code. Deployer projects allow EJB deployers or application assemblers to deploy EJBs on WebLogic Server without knowing the details of the EJB code.

The Servers category lists all WebLogic Servers to which DeployerTool can connect and deploy. See Setting up DeployerTool servers and preferences for information on configuring servers.

Edit panel

The edit panel displays detailed information about the selected .jar, EJB, or EJB property, and allows you to edit certain property fields. The contents of the edit panel differs depending on the object or property you have selected in the object panel. For example, if you click on a .jar file name in the object panel, the edit panel shows display characteristics for the .jar file. If you expand the .jar file and select the Security object, the edit panel displays the file's application role definitions.

Many, but not all, of the fields displayed in the edit panel can be modified. To modify the contents of a field, you can either:

The sections that follow provide details about how to edit fields to perform EJB configuration tasks.

Message panel

The message panel displays informational and error messages as you perform tasks in DeployerTool. The message panel has three separate displays, indicated by the tabs at the bottom of the panel: Messages, Problems, and Console.

The Messages display (active by default) shows current progress and error messages for the task you are performing. For example, when you check EJB classes for compliance with the EJB1.1 specification, DeployerTool displays any non-compliance messages in the Messages display.

The Problems display lists deployment errors for the object you have selected in the object panel. If you select a .jar file in the Object panel, the Problems display lists all errors associated with deployment properties in the .jar. If you select a single EJB in the object panel, only the errors for that bean are displayed.

Deployment property errors can occur because of undefined or incorrectly defined deployment values. The text of each error message indicates the field to enter or modify in order to correct the error. See Validating deployment properties for more information about addressing deployment errors.

The Console display lists any DeployerTool or Java errors that would normally appear in the command shell you used to start DeployerTool.

Starting DeployerTool

To start DeployerTool, first use the setEnv.cmd or setEnv.sh script to set your environment for WebLogic Server Version 5.1:

% setenv

Use the following command to start DeployerTool:

% java -ms24m -mx24m weblogic.EJBDeployerTool

If you installed WebLogic Server under Windows NT, you can also start DeployerTool using the Start menu.

DeployerTool loads and displays an empty program window:

Setting up DeployerTool servers and preferences

DeployerTool enables you to connect and deploy to one or more WebLogic Server products. DeployerTool manages multiple servers in the Servers category of the object panel; each server entry defines the connection properties for a particular WebLogic Server. You must configure at least one new server to begin deploying EJBs.

You can optionally configure DeployerTool and ejbc options to customize the behavior and appearance of the utility, as described in Changing DeployerTool preferences.

Editing WebLogic Server connections

To create, modify, or delete a DeployerTool Server entry:

  1. Start DeployerTool using the instructions in Starting DeployerTool.

  2. Select the Servers category in the object panel.

  3. Click the Add button in the edit panel. DeployerTool creates a blank server entry in the edit panel:

  4. Fill in the fields of the new server entry as follows:

  5. To modify an existing server profile, expand the Server category in the object panel, and click on the name of the server entry to modify. Then edit the server entry fields as necessary.

  6. To delete an existing server profile, expand the Server category in the object panel and click the name of the server entry to delete. Click the Remove button.

Changing DeployerTool preferences

You can modify DeployerTool preferences to specify the Java compiler that ejbc uses during compilation. DeployerTool preferences also affect the location of temporary files and the window size and location for the utility.

To change DeployerTool preferences:

  1. Start DeployerTool using the instructions in Starting DeployerTool.

  2. Select Tools->Preferences... to display the WebLogic EJB Deployer Properties dialog:

  3. To change DeployerTool environment preferences, click on the environment category and edit the properties as follows:

  4. To change ejbc compiler options, click on the ejbc category and edit the properties as follows:

  5. Click OK to save the current options.

Working with EJB deployment units

This section provides basic instructions for:

Loading a .jar file

DeployerTool can import multiple EJB .jar files for editing or deploying to servers.

Note: Before importing a .jar file, make sure the file meets the requirements described in .jar file.

To load a .jar deployment unit:

  1. Start DeployerTool using the instructions in Starting DeployerTool.

  2. Select File->Open...

  3. Type in the complete path to the .jar file you want to import, or navigate to select the file.

  4. Click Open to open the selected .jar file. DeployerTool places the new .jar file in the Deployer category:

Viewing the contents of a .jar

Once you have loaded a .jar file, follow these steps to view the file's contents:

  1. Expand the .jar file contents by clicking the + sign next to its filename in the object panel.

  2. Select the Files item to display details about the class files the .jar contains:

    Columns in the Files display show the name, date modified, size, and relative directory of class files and XML deployment files contained in the .jar. You cannot edit the information stored in these columns.

Setting .jar file display properties

Once you have loaded a .jar file, follow these steps to edit the file's display name or description within DeployerTool:

  1. Select the name of the .jar file in the object panel to display basic file properties:

  2. Edit fields in the edit panel as necessary:

Creating a new .jar file

DeployerTool can help you create a new EJB .jar file from scratch, if you have not yet created one using the jar tool included in your JDK. To create a new .jar file from scratch:

  1. Select File->New... to open the New Jar File dialog:

  2. Type in the full path and filename of the new .jar file to create, or use the Select path... button to navigate to an existing location.

  3. Click Finish when you have specified the new .jar file. DeployerTool adds an entry for the new .jar file to the Developer category.

  4. Select the name of the new .jar file in the object panel.

  5. Select Project->Edit file set... to begin adding files to the .jar. DeployerTool displays the Add or remove project files dialog:

  6. Click the Add files... button to select the class files and XML deployment files to add. Navigate to the individual directories or files you want to add, and click OK.

    Note: If you select a directory, DeployerTool adds all subdirectories and files the directory contains. This helps to preserve the package structure of EJB class files within the new .jar.

  7. Return to step 6 and continue adding files to the .jar as necessary. Click OK when you are finished.

  8. The contents of the new .jar file must observe the requirements described in .jar file. If you need to modify any of the basic EJB properties, follow the steps below in Setting EJB class properties.

Configuring basic EJB properties

The following sections explain how to change basic EJB class and method properties. The deployment properties described in this section are all part of the ejb-jar.xml file defined in the JavaSoft EJB 1.1 specification.

Setting EJB class properties

Follow these steps to view or change the basic home, remote, and EJB class information in an EJB deployment unit:

  1. Start DeployerTool and load the EJB .jar file if you have not already done so. See Starting DeployerTool and Loading a .jar file if you need instructions.

  2. Select the + sign next to the .jar file name to display its contents.

  3. Select the + sign next to the Beans object to display available EJBs in the .jar file.

  4. Select the name of the EJB you want to view or modify. DeployerTool shows the EJB display name and icon files (if applicable) in the edit panel.

  5. Select the Classes tab in the edit panel to display basic EJB class information:

  6. To edit basic EJB class information, click the desired field in the edit panel and type the new value. Editable values include:

  7. Select File->Save to save your changes to the .jar file.

Setting method transaction attributes

Follow these steps to create or change the transaction attributes for EJB methods:

  1. Start DeployerTool and load the EJB .jar file if you have not already done so. See Starting DeployerTool and Loading a .jar file if you need instructions.

  2. Select the + sign next to the .jar file name to display its contents.

  3. Select the .jar file's Method transactions object. If you have already assigned method transaction attributes for the EJB, each collection of attributes is listed as "tx-n" where n is the collection number.

    If no method transactions are available, click the Add button to create a new "tx-0" transaction attribute. DeployerTool highlights the new attribute collection in red to indicate that you have not yet assigned attributes to methods.

  4. Select the + sign next to the Method transactions object to display available transactions.

  5. Select the transaction attribute name that you want to view or edit. DeployerTool displays the transaction attribute assignments in the edit panel:

  6. Choose the transaction attribute you want to apply by selecting it from the Transaction attribute drop-down menu. Valid attributes are:

  7. In the Methods portion of the edit panel, use the + signs to expand the bean and interface name(s) that contains the methods you want to configure.

  8. Check the selection boxes next to listed methods in the home and remote interfaces to apply the selected attribute.

  9. If you want to apply a different transaction attribute to a different selection of methods, return to step 3 and create a new collection.

  10. Select File->Save to save your changes to the .jar file.

Assigning method permissions

The steps that follow describe how to limit access to individual EJB method calls by assigning method-level permissions.

Default method permissions in WebLogic Server

If you specify no method-level permissions for an EJB (there is no method-permission stanza in ejb-jar.xml), WebLogic Server provides "guest" access to all EJB methods in the .jar file. This ensures that EJB methods have some default access permission when deployed on WebLogic Server.

If you want to specify method-level permissions you must do so for all methods in all EJBs stored in the .jar file. If you specify method permissions for even a single EJB method, WebLogic Server denies access for any methods that do not have permissions defined in the ejb-jar file.

Changing method permissions

To change an EJB's method-level permissions:

  1. Start DeployerTool and load the EJB .jar file if you have not already done so. See Starting DeployerTool and Loading a .jar file if you need instructions.

  2. If the .jar file does not yet contain an application role, follow the instructions in Mapping application roles to WebLogic Server principals to create one.

  3. Select the + sign next to the .jar file name to display its contents.

  4. Select the .jar file's Method permissions object. If you have already assigned method permissions for the EJB, each collection of permissions is listed as "perm-n" where n is the collection number.

    If no method permissions are available, click the Add button to create a new "perm-0" permission. DeployerTool highlights the new permission in red to indicate that you have not yet assigned an application role to the EJB methods.

    Note: If you choose to specify method-level permissions, you must do so for all methods in all EJBs in the .jar file. Otherwise, WebLogic Server denies access for methods that have no assigned permissions.

  5. Select the + sign next to the Method permissions object to display available permissions.

  6. Select the permission name you want to view or edit. DeployerTool displays the current application role assignments in the edit panel:

  7. In the Methods portion of the edit panel, use the + signs to expand the bean and interface name(s) that contains the methods you want to configure.

  8. Use the Methods check boxes to select each method to which you want to assign an application role.

  9. Use the Can invoke check boxes to specify which application roles can invoke the selected methods.

  10. Return to step 4 and assign method permissions for all other EJB methods in the .jar file that must be available to clients.

Adding, removing, and changing environment entries

To configure an EJB's environment entries or values, follow these steps:

  1. Start DeployerTool and load the EJB .jar file if you have not already done so. See Starting DeployerTool and Loading a .jar file if you need instructions.

  2. Select the + sign next to the .jar file name to display its contents.

  3. Select the + sign next to the Beans object to display all available EJBs in the .jar file.

  4. Select the + sign next to the EJB name you want to view or modify.

  5. Select the Environment entries item to display the environment properties for the selected EJB. DeployerTool shows the Name, Type, and Value for environment entries in the edit panel:

  6. To edit an existing environment entry, double-click an existing Name, Type, or Value box. Then type in or select a new entry as described below:

  7. To add a new environment entry, click the Add button to display the New environment entry dialog. Specify a new Name, Type, Value, and optional Description for the entry and click OK:

  8. To delete an existing environment entry, click once in the row of the entry you want to delete, then click the Remove button.

  9. Select File->Save to save your changes to the .jar file.

Configuring WebLogic Server deployment properties

WebLogic Server uses deployment properties defined in the weblogic-ejb-jar.xml file to specify an EJB's caching, performance, and clustering properties. Use the following instructions to set or change any of these WebLogic Server-specific properties.

Setting cache and performance properties

  1. Start DeployerTool and load the EJB .jar file if you have not already done so. See Starting DeployerTool and Loading a .jar file if you need instructions.

  2. Select the + sign next to the .jar file name to display its contents.

  3. Select the + sign next to the Beans object to display all available EJBs in the .jar file.

  4. Select the + sign next to the EJB name you want to view or modify.

  5. Select the Optimizations item to display the caching and performance properties for the selected EJB. DeployerTool displays the current property values in the edit panel:

  6. Edit the displayed property values as necessary:

  7. Select File->Save to save your changes to the .jar file.

Setting clustering properties

  1. Start DeployerTool and load the EJB .jar file if you have not already done so. See Starting DeployerTool and Loading a .jar file if you need instructions.

  2. Select the + sign next to the .jar file name to display its contents.

  3. Select the + sign next to the Beans object to display all available EJBs in the .jar file.

  4. Select the + sign next to the EJB name you want to view or modify.

  5. Select the Clustering item to display the clustering properties for the selected EJB. DeployerTool displays the current property values in the edit panel:

  6. Edit the displayed property values as necessary:

Mapping EJB references

Mapping application roles to WebLogic Server principals

EJB providers can define application roles for EJBs in the ejb-jar.xml deployment file. Application roles define required roles for EJBs, but they do not specify the actual security principal names in the running application server.

DeployerTool enables you to create EJB application roles and map them to actual WebLogic Server security principal names during the deployment process.

To map WebLogic Server principals to EJB application roles:

  1. Start DeployerTool using the instructions in Starting DeployerTool.

  2. If you have not yet done so, add one or more server profiles using the instructions in Setting up DeployerTool servers and preferences.

  3. Select the WebLogic Server you want to deploy to by clicking on its name in the Server category.

  4. Load an EJB deployment unit using the instructions in Loading a .jar file.

  5. Expand the .jar file by clicking the + sign next to its name.

  6. Select the .jar file's Security item to display available application roles in the .jar file, and available principal names in the selected WebLogic Server.

    If the .jar file does not contain any application roles, click Add and enter a name for the new role.

  7. Click on the name of the application role to modify. DeployerTool shows which of the current principal names are members of the role by checking the In role checkbox:

  8. To change membership in the selected application role, check or un-check the In role boxes for the principals you want to add or remove.

  9. To delete a selected application role, click the Remove button.

  10. Select File->Save to save your changes to the .jar file.

Mapping EJB references

To map EJB references to actual EJBs:

  1. Start DeployerTool using the instructions in Starting DeployerTool.

  2. If you have not yet done so, add one or more server profiles using the instructions in Setting up DeployerTool servers and preferences.

  3. Select the WebLogic Server you want to deploy to by clicking on its name in the Server category.

  4. Load an EJB deployment unit using the instructions in Loading a .jar file.

  5. Expand the .jar file by clicking the + sign next to its name.

  6. Expand the Beans item to display all available EJBs in the .jar file.

  7. Expand the EJB name that contains the references you want to view or modify.

  8. Select the EJB's EJB references item to display available references in the .jar file.

    If the .jar file does not contain any EJB references, click Add to create one.

  9. Expand the EJB References object (if it is not already expanded) to view available references in the .jar file.

  10. Select a listed EJB reference to display its properties in the edit panel:

  11. Modify the EJB reference properties as follows:

Mapping resource factory references

  1. Start DeployerTool using the instructions in Starting DeployerTool.

  2. If you have not yet done so, add one or more server profiles using the instructions in Setting up DeployerTool servers and preferences.

  3. Select the WebLogic Server you want to deploy to by clicking on its name in the Server category.

  4. Load an EJB deployment unit using the instructions in Loading a .jar file.

  5. Expand the .jar file by clicking the + sign next to its name.

  6. Expand the Beans item to display all available EJBs in the .jar file.

  7. Expand the EJB name that contains the resource references you want to view or modify.

  8. Select the EJB's Resource factory references item to display available resource references in the .jar file.

    If the .jar file does not contain any EJB references, click Add and enter a name for the new reference.

  9. Expand the Resource factory references item to list references in the .jar file.

  10. Select a listed resource factory reference to display its properties in the edit panel:

  11. Modify the resource factory reference properties as follows:

Configuring persistence properties for entity EJBs

You can use DeployerTool to configure persistence properties for Entity EJBs that use container-managed persistence. The following sections describe how to configure properties for EJBs that use WebLogic Server RDBMS-based persistence.

If you use a third-party persistence type, configuration may take place within DeployerTool or in a separate utility or procedure. In either case, refer to your persistence type documentation for instructions.

Configuring container-managed fields

To view or modify the container-managed fields defined in your XML deployment files:

  1. Start DeployerTool using the instructions in Starting DeployerTool.

  2. Load an EJB deployment unit that uses WebLogic Server RDBMS-based persistence services.

  3. Expand the .jar file by clicking the + sign next to its name.

  4. Expand the Beans item to display available EJBs in the .jar file.

  5. Expand the EJB name that uses WebLogic Server RDBMS-based persistence.

  6. Select the Persistence object to display the EJB's persistent fields and primary key definition:

  7. To change the primary key type, select a type from the Primary key type drop-down menu. You can specify a simple primary key by selecting a simple Java type. Select a compiled primary key class type to define a compound key. See Simple and compound primary keys for more information.

  8. For simple primary keys, select a Primary key field from the drop-down menu.

  9. Select the Container-managed check boxes next to a field name to have WebLogic Server automatically manage persistence for those fields using RDBMS-based persistence.

    Note: For each field that you designate as Container-managed, define the mapping of the field to a database column using the instructions in Configuring WebLogic Server RDBMS-based persistence.

Configuring WebLogic Server RDBMS-based persistence

DeployerTool enables you to perform the following configuration tasks for beans that use WebLogic Server RDBMS-based persistence services:

Specifying the table and connection for RDBMS operations

  1. Start DeployerTool using the instructions in Starting DeployerTool.

  2. Load an EJB deployment unit that uses WebLogic Server RDBMS-based persistence services.

  3. Expand the .jar file by clicking the + sign next to its name.

  4. Expand the Beans item to display available EJBs in the .jar file.

  5. Expand the EJB name that uses WebLogic Server RDBMS-based persistence.

  6. Expand the Persistence item to list available backing stores.

  7. Expand the Backing stores item to display the WebLogic RDBMS Persistence backing store.

  8. Select the WebLogic RDBMS Persistence backing store to display configuration properties in the edit panel.

  9. Click the Configuration tab in the edit panel to display basic backing store properties:

  10. Edit backing store fields to define the high-level mapping for RDBMS operations:

Mapping container-managed fields to database columns

Follow these steps to map individual EJB container-managed fields to columns in a selected datastore:

  1. Follow the instructions in Specifying the table and connection for RDBMS operations to open the WebLogic RDBMS Persistence backing store.

  2. Click the Field-column map tab in the edit panel to display the current mapping between container-managed fields and database columns:

  3. To change the database column used to back a container-managed EJB field, double click the Table column name and type in the new name.

    Note: WebLogic Server does not support using quoted RDBMS keywords in a column mapping. For example, you cannot map EJB fields to columns named "create" or "select" if those names are reserved in the underlying datastore.

Editing EJB finder method expressions

Follow these steps to modify the WebLogic Query Language (WLQL) expressions and Java expressions used in EJB finder methods:

  1. Follow the instructions in Specifying the table and connection for RDBMS operations to open the WebLogic RDBMS Persistence backing store.

  2. Click the Finders tab in the edit panel to display the finder methods available in your deployment files:

  3. To view or change the expressions used in a particular finder method, double click the method name to display an Edit finder method dialog:

    The Name and Parameter(s) section of the dialog lists all parameters to the selected finder method along with each parameter's number designation. In the example above, the findBigAccounts method has a single parameter of type double, represented by $0. Additional parameters would be designated by $1, $2, and so forth.

    The Query and Expression(s) section lists the text of the WLQL query for the finder method. The WLQL query uses number designations ($0 in the example above) to represent values supplied by the finder method arguments, or values supplied by embedded Java expressions.

    The bottom portion of the dialog lists optional Java expressions that you can embed within the WLQL query. As with the parameters Name and Parameter(s) section, each Java expression uses a number designation. In the above example, adding a new Java expression would yield the number designation "1", since the initial value "0" is used by the method parameter. Within the WLQL, expression, $0 would represent the method parameter, and $1 would represent the embedded Java expression.

  4. To edit the finder's WLQL query, simply edit the text in the Query and Expression(s) section of the dialog. See Using WebLogic Query Language (WLQL) for complete information about WLQL syntax and conventions.

  5. To add an embedded Java expression, click the Add button and follow the instructions below.

  6. To edit an embedded Java expression, double-click a column and edit the value as appropriate:

  7. Click OK or Cancel to save or cancel changes to the finder method.

Validating deployment units

DeployerTool validates EJB deployment units in two ways by:

Validating deployment properties

When you load a new .jar file or change deployment properties, DeployerTool automatically checks the properties to ensure that supplied values are valid and appropriate for the selected server. This includes:

If DeployerTool finds any errors in the deployment properties that would prevent you from deploying to the selected server, it lists those errors in the Problems display of the message panel. DeployerTool also highlights in red the .jar file, EJB, method, or property category that contains the error.

To address deployment property errors:

  1. Start DeployerTool and open the .jar file that contains deployment errors.

  2. Click the Problems tab in the messages panel to display the deployment error messages.

  3. Expand the red highlighted objects in the object panel to locate the source of individual deployment errors. As you select nested objects, the Problems display changes to show only those deployment errors in the current object or property listing.

  4. Edit the property value as indicated in the error message to correct the problem. DeployerTool validates your entry immediately after editing, so you can determine if the problem is resolved.

  5. Continue addressing highlighted items in the object panel as necessary. Once you have addressed all of the deployment errors, the .jar file entry will no longer appear highlighted, and you can continue compiling or deploying the EJBs.

Checking for compliance with EJB 1.1

DeployerTool provides a compliance checking option to check compiled EJB classes for compliance to the EJB 1.1 specification. To check the contents of a deployment unit for compliance to EJB 1.1:

  1. Start DeployerTool and open the .jar file that you want to check for compliance.

  2. If you have not done so, address all deployment property errors using the instructions in Validating deployment properties. You cannot check for compliance to the EJB 1.1 specification until all deployment properties are valid.

  3. Select the name of the .jar file to check in the DeployerTool object panel.

  4. Select the Messages tab in the messages panel.

  5. Select Tools->Check Compliance to begin the validation process.

    DeployerTool displays any noncompliance messages in the message panel. Individual messages are tagged with a section number, which indicates the section of the JavaSoft EJB 1.1 specification that describes the requirement.

    If you need more information about how to address a noncompliance message, refer to one of the following sources:

Compiling and deploying EJBs

Compiling EJB container classes

For each EJB deployment present in a .jar file, DeployerTool calls the ejbc compiler to generate container implementation classes. The implementation classes are then processed through the RMI compiler, which generates a client-side stub and a server-side skeleton.

When you use DeployerTool to generate container classes, the files are inserted back into the .jar file. If you want to place the container classes into a different file, use ejbc from the command line, as described in ejbc.

By default, ejbc uses javac as a compiler. For faster performance, specify a different compiler (such as Symantec's sj) by setting up ejbc preferences within DeployerTool. See Setting up DeployerTool servers and preferences for more information.

To generate container classes for EJBs you have loaded:

  1. If you have not done so, address all deployment property errors using the instructions in Validating deployment properties. You cannot generate container classes until all deployment properties are valid.

  2. Select the name of the .jar file to check in the DeployerTool object panel.

  3. Select Tools->Generate container... to begin compiling EJBs in the .jar file.

Deploying .jar files to WebLogic Server

To deploy a .jar file to WebLogic Server:

  1. If you have not done so, compile the container classes into the .jar file using the instructions in Compiling EJB container classes.

  2. Select the name of the .jar file to check in the DeployerTool object panel.

  3. Select Tools->Deploy... to deploy the .jar file to the default WebLogic Server. If you want to use a non-default server, select Tools->Deploy To...->server_name where server_name is the WebLogic Server profile you want to use.

    Note: DeployerTool uses hot deployment, via the deploy command shell utility, to deploy EJBs. See Deploying EJBs in WebLogic Server for general information on deploying EJBs. See Deploying EJBs in a running WebLogic Server (Hot Deployment) for specific information and restrictions regarding hot deployment.