BEA Logo BEA WebLogic Enterprise Release 5.1

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

 

   WebLogic Enterprise Doc Home   |   Enterprise JavaBeans topics   |   Previous Topic   |   Next Topic   |   Contents   |   Index

Deploying EJBs with the WebLogic Enterprise EJB Deployer

 

This topic includes the following sections:

 


Introducing the WebLogic Enterprise EJB Deployer

This topic includes the following sections:

The WebLogic Enterprise-TM (WLE) WebLogic Enterprise EJB Deployer provides a graphical interface that Application Assemblers can use to deploy EJBs to one or more Java servers. The WebLogic Enterprise EJB Deployer simplifies the process of configuring EJB deployment properties and mapping EJB references to actual resource factories, roles and other EJBs available on a Java server.

The WebLogic Enterprise EJB Deployer provides many services related to EJB deployment. You can use it to:

For general information about deploying EJBs on WebLogic Enterprise, or for information on using hot deployment features, see "Developing WebLogic Enterprise EJB Applications" in Getting Started.

WebLogic Enterprise Deployment Files

When you modify deployment properties with the WebLogic Enterprise EJB Deployer, the utility updates and saves information in the XML deployment files, ensuring that the XML is correct for its associated Document Type Definition (DTD). The WebLogic Enterprise EJB Deployer can modify all properties in ejb-jar.xml. It can also create the weblogic-ejb-extensions.xml file if it is not available in the EJB JAR.

weblogic-ejb-extensions.xml contains properties that define the performance behavior of EJBs. It also contains properties that map available WebLogic Enterprise resources to EJBs. WebLogic Enterprise 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-extensions.xml are linked to EJB names in ejb-jar.xml and resource names of EJBs running in the WebLogic Enterprise environment. If you want to edit the XML deployment files manually, outside of the WebLogic Enterprise EJB Deployer utility, see the WebLogic Enterprise EJB XML Reference.

Roles and Responsibilities

The WebLogic Enterprise EJB Deployer is designed primarily for:

To satisfy the requirements of these roles, the WebLogic Enterprise EJB Deployer provides complete controls for managing multiple EJB JAR files and Java servers, and for configuring WebLogic Enterprise deployment properties and resources. Roles are designated by two primary types of WebLogic Enterprise EJB Deployer 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 Java servers. Using deployer, you can automatically create the required weblogic-ejb-extensions.xml file with valid deployment properties. Deployer projects enable you to work with EJB JAR files without knowing the details of the EJB code.

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 Enterprise provides the DDConverter utility to generate an ejb-jar.xml file from an existing WebLogic Enterprise-compatible text descriptor.

Requirements

Requirements for using the WebLogic Enterprise EJB Deployer depend on whether you are a Deployer or Developer.

To use the WebLogic Enterprise EJB Deployer in the Deployer role, you must have:

To use the WebLogic Enterprise EJB Deployer in the Developer role, you must have:

Java ARchive (EJB JAR) File

An EJB module in the WebLogic Enterprise EJB Deployer consists of a Java Archive (EJB JAR) file. The EJB 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 EJB 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 EJB JAR file, as was required with the Enterprise JavaBeans Specification 1.0.

Optionally, the EJB JAR file can contain the weblogic-ejb-extensions.xml file, which defines additional deployment properties for EJBs. If the EJB JAR does not contain this file, the WebLogic Enterprise EJB Deployer creates it as necessary during the deployment process.

Listing 1-1 shows the contents of a simple EJB JAR file that can be loaded into the WebLogic Enterprise EJB Deployer:

Listing 1-1 Sample EJB JAR File


$ 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-extensions.xml

Note: Classes in the EJB JAR file must reside in directories that match their Java package hierarchy.

Java Servers

The WebLogic Enterprise EJB Deployer connects to one or more Java servers during the deployment process, enabling you to map references in the deployment description files to actual Java server resources, and to pass some information for the module to the Java server.

 


Getting Started

To begin using the WebLogic Enterprise EJB Deployer:

  1. Read Introducing the WebLogic Enterprise EJB Deployer to learn how to work with the WebLogic Enterprise EJB Deployer user interface.

  2. Start the WebLogic Enterprise EJB Deployer using the instructions in Starting the WebLogic Enterprise EJB Deployer.

  3. Load the EJB JAR file you want to deploy using the instructions in Working with EJB Modules.

  4. Read additional sections as necessary for:

  5. Deploy the EJB JAR file to one or more Java servers using the instructions in Compiling and Deploying EJBs.

 


Starting the WebLogic Enterprise EJB Deployer

To start the WebLogic Enterprise EJB Deployer, enter the following command:

% java -ms24m -mx24m weblogic.EJBDeployWizard

The Java standard -ms24m and -mx24m parameters are optional.

The WebLogic Enterprise EJB Deployer loads and displays an empty program window, as shown in Figure 1-1.

Figure 1-1 WebLogic Enterprise EJB Deployer Program Window

The WebLogic Enterprise EJB Deployer program window is divided into the following main components:

Menu Bar

The menu bar contains several menus to:

Toolbar

Icons in the toolbar provide quick access to selected WebLogic Enterprise EJB Deployer menu options. Hold your cursor over an individual icon to learn its function.

Object Panel

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

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

Top-level Categories

The top-level categories in the Object panel represent WebLogic Enterprise EJB Deployer Projects and Servers. WebLogic Enterprise EJB Deployer 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 Java servers without knowing the details of the EJB code.

The Servers category lists all Java servers to which the WebLogic Enterprise EJB Deployer can connect and deploy. See Setting Up Java Servers and WebLogic Enterprise EJB Deployer Preferences for information on configuring servers.

Properties Panel

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

Many, but not all, of the fields displayed in the Properties 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 the WebLogic Enterprise EJB Deployer. The Message panel has three separate displays, indicated by the tabs at the bottom of the panel: Messages, Problems, and Console.

 


Setting Up Java Servers and WebLogic Enterprise EJB Deployer Preferences

This topic includes the following sections:

Viewing Java Server Properties

The WebLogic Enterprise EJB Deployer enables you to connect and deploy to one or more Java servers. The WebLogic Enterprise EJB Deployer displays the properties of all running Java servers in the Servers category of the Object panel. The Java server properties are defined in the application's UBBCONFIG file. With the WebLogic Enterprise EJB Deployer, you can select a default server for deployment and you can deploy, redeploy, and undeploy to one or more Java servers, but you cannot change the properties. You must configure at least one new server to begin deploying EJBs. For more information about setting up Java servers, see "Creating a Configuration File" in the Administration Guide.

Note: The WebLogic Enterprise EJB Deployer provides access to running Java servers within a WebLogic Enterprise domain. The domain is defined in a UBBCONFIG file. You can change domains by changing the tuxconfig setting, as described in Changing Preferences for the WebLogic Enterprise EJB Deployer.

To view the properties of all running Java servers:

  1. Start the WebLogic Enterprise EJB Deployer using the instructions in Starting the WebLogic Enterprise EJB Deployer.

  2. Select the Servers category in the Object panel.

  3. Click the name of a server in the Properties panel. The WebLogic Enterprise EJB Deployer displays the properties for the selected Java server, as shown in Figure 1-2.

    Figure 1-2 Java Server Properties

    The WebLogic Enterprise EJB Deployer displays the following properties:

  4. To undeploy a module, select it from the Modules list and click the Undeploy button.

Changing Preferences for the WebLogic Enterprise EJB Deployer

You can optionally configure WebLogic Enterprise EJB Deployer and ejbc options to customize the behavior and appearance of the tool. You can modify the WebLogic Enterprise EJB Deployer preferences to specify the Java compiler that ejbc uses during compilation. The WebLogic Enterprise EJB Deployer preferences also affect the location of temporary files and the window size and location for the utility.

The WebLogic Enterprise EJB Deployer stores these settings in the deployer.properties file. You can use an ASCII text editor to change some of these settings. For more information, see WebLogic Enterprise EJB Deployer Properties File.

Changing WebLogic Enterprise EJB Deployer Preferences

To change WebLogic Enterprise EJB Deployer preferences:

  1. Start the WebLogic Enterprise EJB Deployer using the instructions in Starting the WebLogic Enterprise EJB Deployer.

  2. From the Tools menu, choose Preferences... to display the WebLogic EJB Deployer Properties dialog box, as shown in Figure 1-3.

    Figure 1-3 WebLogic Enterprise EJB Deployer Properties Dialog Box

  3. Click the environment category.

  4. Edit the following properties:

  5. Click OK.

Changing Compiler Options

To change ejbc compiler options:

  1. Start the WebLogic Enterprise EJB Deployer using the instructions in Starting the WebLogic Enterprise EJB Deployer.

  2. From the Tools menu, choose Preferences... to display the WebLogic EJB Deployer Properties dialog box, as shown in Figure 1-3.

  3. Click the ejbc category to display the WebLogic EJB Deployer Properties dialog box, as shown in Figure 1-4.

    Figure 1-4 ejbc Properties

  4. Edit the following properties:

  5. Click OK to save the current options.

 


Working with EJB Modules

This topic includes the following sections:

Loading an EJB JAR File

The WebLogic Enterprise EJB Deployer can import multiple EJB JAR files for editing or deploying to servers.

Note: Before importing an EJB JAR file, make sure the file meets the requirements described in Java ARchive (EJB JAR) File.

To load an EJB JAR module:

  1. Start the WebLogic Enterprise EJB Deployer using the instructions in Starting the WebLogic Enterprise EJB Deployer.

  2. From the File menu, choose Open...

  3. Enter the complete path to the EJB JAR file you want to import, or navigate to select the file.

  4. Click Open to open the selected EJB JAR file. The WebLogic Enterprise EJB Deployer places the new EJB JAR file in the Deployer category, as shown in Figure 1-5.

    Figure 1-5 New EJB Jar File

Viewing the Contents of an EJB JAR File

Once you have loaded an EJB JAR file, to view the file's contents, complete the following steps:

  1. Expand the EJB 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 EJB JAR contains, as shown in Figure 1-6.

    Figure 1-6 Class Files in an EJB JAR File

    .:

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

Setting EJB JAR File Display Properties

Once you have loaded an EJB JAR file, to edit the file's display name or description within the WebLogic Enterprise EJB Deployer, complete the following steps:

  1. Select the name of the EJB JAR file in the Object panel to display basic file properties, as shown in Figure 1-7.

    Figure 1-7 Basic EJB JAR File Properties

  2. Edit fields in the Properties panel as necessary:

Creating a New EJB JAR File

The WebLogic Enterprise EJB Deployer 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 EJB JAR file from scratch:

  1. From the File menu, choose New... to open the New Jar File dialog box, as shown in Figure 1-8.

    Figure 1-8 New Jar File Dialog Box

  2. Enter the full path and filename of the new EJB 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 EJB JAR file. The WebLogic Enterprise EJB Deployer adds an entry for the new EJB JAR file to the Developer category.

  4. The contents of the new EJB JAR file must observe the requirements described in Java ARchive (EJB JAR) File. If you need to modify any of the basic EJB properties, select the EJB JAR file in the Object panel and follow the instructions in Setting EJB Class Properties.

 


Configuring Basic EJB Properties

This topic includes the following sections:

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 Enterprise JavaBeans Specification 1.1.

Setting EJB Class Properties

To view or change the basic home, remote, and EJB class information in an EJB module, complete the following steps:

  1. Start the WebLogic Enterprise EJB Deployer and load the EJB JAR file, if you have not already done so. For instructions, see Starting the WebLogic Enterprise EJB Deployer and Loading an EJB JAR File.

  2. Select the + sign next to the EJB JAR filename to display its contents.

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

  4. Select the name of the EJB you want to view or modify. The WebLogic Enterprise EJB Deployer shows the EJB display name and icon files (if applicable) in the Properties panel.

  5. Select the Classes tab in the Properties panel to display basic EJB class information, as shown in Figure 1-9.

    Figure 1-9 Classes Tab

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

  7. From the File menu, choose Save to save your changes to the EJB JAR file.

Setting Method Transaction Attributes

To create or change the transaction attributes for EJB methods, complete the following steps:

  1. Start the WebLogic Enterprise EJB Deployer and load the EJB JAR file, if you have not already done so. For instructions, see Starting the WebLogic Enterprise EJB Deployer and Loading an EJB JAR File.

  2. Select the + sign next to the EJB JAR filename to display its contents.

  3. Select the EJB 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. The WebLogic Enterprise EJB Deployer 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. The WebLogic Enterprise EJB Deployer displays the transaction attribute assignments in the Properties panel, as shown in Figure 1-10.

    Figure 1-10 Transaction Attributes

  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 Properties 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. From the File menu, choose Save to save your changes to the EJB 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 Enterprise

You must specify method-level permissions for an EJB. If you specify no method-level permissions for an EJB (there is no method-permission stanza in ejb-jar.xml), all EJB methods in the EJB JAR file will not be accessible.

Note: You must specify method-level permissions for all methods in all EJBs stored in the EJB JAR file. WebLogic Enterprise 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 the WebLogic Enterprise EJB Deployer and load the EJB JAR file, if you have not already done so. For instructions, see Starting the WebLogic Enterprise EJB Deployer and Loading an EJB JAR File.

  2. If the EJB JAR file does not yet contain an application role, follow the instructions in Mapping Application Roles to WebLogic Enterprise Principals to create one.

  3. Select the + sign next to the EJB JAR filename to display its contents.

  4. Select the EJB 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. The WebLogic Enterprise EJB Deployer 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 EJB JAR file. Otherwise, WebLogic Enterprise 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. The WebLogic Enterprise EJB Deployer displays the current application role assignments in the Properties panel, as shown in Figure 1-11.

    Figure 1-11 Application Role Assignments

  7. In the Methods portion of the Properties 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 EJB JAR file that must be available to clients.

Adding, Removing, and Changing Environment Entries

To configure an EJB's environment entries or values, complete the following steps:

  1. Start the WebLogic Enterprise EJB Deployer and load the EJB JAR file, if you have not already done so. For instructions, see Starting the WebLogic Enterprise EJB Deployer and Loading an EJB JAR File.

  2. Select the + sign next to the EJB JAR filename to display its contents.

  3. Select the + sign next to the Beans object to display all available EJBs in the EJB 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. The WebLogic Enterprise EJB Deployer shows the Name, Type, and Value for environment entries in the Properties panel, as shown in Figure 1-12.

    Figure 1-12 Environment Entries

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

  7. To add a new environment entry, click the Add button to display the Input New Environment Entry dialog box, as shown in Figure 1-13.

    Figure 1-13 Input New Environment Entry Dialog Box

    Specify a new Name, Type, Value, and optional Description for the entry, and then click OK.

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

  9. From the File menu, choose Save to save your changes to the EJB JAR file.

 


Configuring Deployment Properties

WebLogic Enterprise uses deployment properties defined in the weblogic-ejb-extensions.xml file to specify an EJB's performance properties. Use the following instructions to set or change any of these WebLogic Enterprise-specific properties.

  1. Start the WebLogic Enterprise EJB Deployer and load the EJB JAR file, if you have not already done so. For instructions, see Starting the WebLogic Enterprise EJB Deployer and Loading an EJB JAR File.

  2. Select the + sign next to the EJB JAR filename to display its contents.

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

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

  5. Select the Optimizations item to display the caching and performance properties for the selected EJB. The WebLogic Enterprise EJB Deployer displays the current property values in the Properties panel, as shown in Figure 1-14.

    Figure 1-14 Performance Optimizations

  6. Edit the displayed property values as necessary:

  7. From the File menu, choose Save to save your changes to the EJB JAR file.

 


Mapping EJB References

This topic includes the following sections:

Mapping Application Roles to WebLogic Enterprise Principals

EJB providers can define application roles for EJBs in the ejb-jar.xml deployment file. Application roles (security groups) define required roles for EJBs, but they do not specify the actual security principal names in the running application server. Security roles are defined and administered (in the UBBCONFIG file) per domain. For more information about security roles, see "Configuring Authentication" in Using Security.

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

To map principals to EJB application roles:

  1. Start the WebLogic Enterprise EJB Deployer using the instructions in Starting the WebLogic Enterprise EJB Deployer.

  2. Select the Java server you want to deploy to by clicking on its name in the Server category.

  3. Load an EJB module using the instructions in Loading an EJB JAR File.

  4. Expand the EJB JAR file by clicking the + sign next to its name.

  5. Select the EJB JAR file's Security item to display available application roles in the EJB JAR file, and available principal names in the selected Java server.

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

  6. Click the name of the application role to modify. The WebLogic Enterprise EJB Deployer shows which of the current principal names are members of the role by checking the In role checkbox, as shown in Figure 1-15.

    Figure 1-15 Application Roles and Principals

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

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

  9. From the File menu, choose Save to save your changes to the EJB JAR file.

Mapping EJB References

To map EJB references to actual EJBs:

  1. Start the WebLogic Enterprise EJB Deployer using the instructions in Starting the WebLogic Enterprise EJB Deployer.

  2. Select the Java server you want to deploy to by clicking on its name in the Server category.

  3. Load an EJB module using the instructions in Loading an EJB JAR File.

  4. Expand the EJB JAR file by clicking the + sign next to its name.

  5. Expand the Beans item to display all available EJBs in the EJB JAR file.

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

  7. Select the EJB's EJB references item to display available references in the EJB JAR file.

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

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

  9. Select a listed EJB reference to display its properties in the Properties panel, as shown in Figure 1-16.

    Figure 1-16 EJB References

  10. Edit the following EJB reference properties:

Mapping Resource Factory References

To map resource factory references:

  1. Start the WebLogic Enterprise EJB Deployer using the instructions in Starting the WebLogic Enterprise EJB Deployer.

  2. Select the Java server you want to deploy to by clicking on its name in the Server category.

  3. Load an EJB module using the instructions in Loading an EJB JAR File.

  4. Expand the EJB JAR file by clicking the + sign next to its name.

  5. Expand the Beans item to display all available EJBs in the EJB JAR file.

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

  7. Select the EJB's resource factory references item to display available resource references in the EJB JAR file.

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

  8. Expand the resource factory references item to list references in the EJB JAR file.

  9. Select a listed resource factory reference to display its properties in the Properties panel, as shown in Figure 1-17.

    Figure 1-17 Resource Factory References

  10. Edit the following resource factory reference properties:

 


Configuring Persistence Properties for EJBs

This topic includes the following sections:

You can use the WebLogic Enterprise EJB Deployer to configure persistence properties for entity beans and stateful session beans that use container-managed persistence. For container-managed persistence, the WebLogic Enterprise EJB container supports storing an EJB in either of the following formats:

You can use the WebLogic Enterprise EJB Deployer to configure JDBC-based or file-based persistence properties for stateful session beans or entity beans. For more information about EJB persistence, see "Developing WebLogic Enterprise EJB Applications" in Getting Started.

Configuring Container-managed Fields

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

  1. Start the WebLogic Enterprise EJB Deployer using the instructions in Starting the WebLogic Enterprise EJB Deployer.

  2. Load an EJB module that uses JDBC-based persistence.

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

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

  5. Expand the EJB name that uses JDBC-based persistence.

  6. Select the Persistence object to display the JDBC persistence properties, as shown in Figure 1-18.

    Figure 1-18 JDBC Persistence Properties

  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.

  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 Enterprise automatically manage persistence for those fields using JDBC-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 JDBC-based Persistence for Entity Beans.

Configuring JDBC-based Persistence for Entity Beans

The WebLogic Enterprise EJB Deployer enables you to perform the following configuration tasks for entity beans that use JDBC-based persistence:

Specifying the Table and Connection for JDBC Operations

To specify table and connection properties for JDBC operations:

  1. Start the WebLogic Enterprise EJB Deployer using the instructions in Starting the WebLogic Enterprise EJB Deployer.

  2. Load an EJB module that uses JDBC-based persistence.

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

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

  5. Expand the name of an entity bean that uses JDBC-based persistence.

  6. Expand the Persistence item.

  7. Select JDBC to display configuration properties in the Properties panel.

  8. Click the Configuration tab in the Properties panel to display basic configuration properties, as shown in Figure 1-19.

    Figure 1-19 JDBC Persistence Configuration Properties

  9. Edit configuration properties to define the high-level mapping for JDBC operations:

Mapping Container-managed Fields to Database Columns

To map individual EJB container-managed fields to columns in a selected datastore:

  1. Follow the instructions in Specifying the Table and Connection for JDBC Operations to open the JDBC panel.

  2. Click the Field-column map tab in the Properties panel to display the current mapping between container-managed fields and database columns, as shown in Figure 1-20.

    Figure 1-20 Field-column Mappings

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

    Note: WebLogic Enterprise 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

To modify the finder signature expressions used in EJB finder methods:

  1. Follow the instructions in Specifying the Table and Connection for JDBC Operations to open the JDBC panel.

  2. Click the Finders tab in the Properties panel to display the finder methods available in your deployment files, as shown in Figure 1-21.

    Figure 1-21 Finder Methods

  3. To view or change the expressions used in a particular finder method, double click the method name to display an Edit Expression dialog box, as shown in Figure 1-22.

    Figure 1-22 Edit Expression Dialog Box

    The Edit Expression dialog box displays an editing window for changing the expression for the selected finder signature.

  4. Edit the expression. The expression must comply with the following syntax rules.

    Syntax

    The query grammar syntax has an expression prefix notation of:

    [operator operand1 operand2]

    Operators

    Valid operators include:

  5. Click OK or Cancel to save or cancel changes to the finder expression.

Configuring File-based Persistence for Stateful Session Beans

To configure file-based persistence for a stateful session bean with container-managed persistence:

  1. Start the WebLogic Enterprise EJB Deployer using the instructions in Starting the WebLogic Enterprise EJB Deployer.

  2. Load an EJB module that uses file-based persistence.

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

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

  5. Expand the name of a stateful session bean.

  6. Expand the persistence item.

  7. To enable file-based persistence for this bean, you must select the checkbox under Container managed, as shown in Figure 1-23.

    Figure 1-23 File-based Persistence Checkbox

  8. Select File to display the Properties panel, as shown in Figure 1-24.

    Figure 1-24 File-based Persistence Properties

  9. Enter the full path and filename of the file to use for file-based persistence, or click the Select... button to navigate to an existing file.

 


Validating Modules

This topic includes the following sections:

The WebLogic Enterprise EJB Deployer validates EJB modules in the following ways:

Validating Deployment Properties

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

If the WebLogic Enterprise EJB Deployer 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. The WebLogic Enterprise EJB Deployer also highlights in red the EJB JAR file, EJB, method, or property category that contains the error.

To address deployment property errors:

  1. Start the WebLogic Enterprise EJB Deployer and open the EJB JAR file that contains deployment errors. For instructions, see Starting the WebLogic Enterprise EJB Deployer and Loading an EJB JAR File.

  2. Click the Problems tab in the Message 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. The WebLogic Enterprise EJB Deployer 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 EJB JAR file entry will no longer appear highlighted, and you can continue compiling or deploying the EJBs.

Checking for Compliance with the Enterprise JavaBeans Specification 1.1

The WebLogic Enterprise EJB Deployer provides a compliance checking option to check compiled EJB classes for compliance with the Enterprise JavaBeans Specification 1.1 published by Sun Microsystems, Inc. To check the contents of a module for compliance with the specification:

  1. Start the WebLogic Enterprise EJB Deployer and open the EJB JAR file that you want to check for compliance. For instructions, see Starting the WebLogic Enterprise EJB Deployer and Loading an EJB JAR File.

  2. If you have not already done so, address all deployment property errors using the instructions in Validating Deployment Properties. You cannot check for compliance to the Enterprise JavaBeans Specification 1.1 until all deployment properties are valid.

  3. Select the name of the EJB JAR file to check in the WebLogic Enterprise EJB Deployer Object panel.

  4. Select the Messages tab in the Message panel.

  5. From the Tools menu, choose Check Compliance to begin the validation process.

    The WebLogic Enterprise EJB Deployer displays any noncompliance messages in the Message panel.

    For more information about system messages, see the System Messages in the WebLogic Enterprise online documentation. If you need more information about how to address a noncompliance message, see the Enterprise JavaBeans Specification 1.1.

After addressing known compliance errors, recompile your classes, repackage the EJB JAR file, and use the WebLogic Enterprise EJB Deployer to repeat the compliance check.

 


Compiling and Deploying EJBs

This topic includes the following sections:

Compiling EJB Container Classes

For each EJB deployment present in an EJB JAR file, the WebLogic Enterprise EJB Deployer 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 the WebLogic Enterprise EJB Deployer to generate container classes, the files are inserted back into the EJB JAR file. If you want to place the container classes into a different file, use ejbc from the command line, as described in Commands, Systems Processes, and MIB Reference.

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 the WebLogic Enterprise EJB Deployer. See Setting Up Java Servers and WebLogic Enterprise EJB Deployer Preferences for more information.

To generate container classes for EJBs:

  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 EJB JAR file to check in the WebLogic Enterprise EJB Deployer Object panel.

  3. From the Tool menu, choose Generate container... to begin compiling EJBs in the EJB JAR file.

Deploying EJB JAR Files to Java Servers

You can deploy EJB JAR files to one or more running Java servers in accordance with the following requirements:

To deploy an EJB JAR file to a Java server:

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

  2. If you have not done so, select the WebLogic Enterprise domain in which the target Java server is running, as described in Changing WebLogic Enterprise EJB Deployer Preferences.

  3. Select the name of the EJB JAR file to check in the WebLogic Enterprise EJB Deployer Object panel.

  4. Do one of the following:

  5. Edit the following properties, which are used in the deployment process:

  6. Click OK.

    Note: The WebLogic Enterprise EJB Deployer uses hot deployment, via the deploy command shell utility, to deploy Enterprise JavaBeans (EJBs). For more information, see "Developing WebLogic Enterprise EJB Applications" in Getting Started.

Undeploying EJB JAR Files

Undeploying an EJB JAR file removes it from a Java server on which it is deployed. To undeploy an EJB JAR file from a Java server:

  1. Start the WebLogic Enterprise EJB Deployer using the instructions in Starting the WebLogic Enterprise EJB Deployer.

  2. Select the Servers category in the Object panel.

  3. In the Properties panel, click the name of the server from which you want to undeploy the EJB JAR file. The WebLogic Enterprise EJB Deployer displays the properties for the selected Java server, as shown in Figure 1-26.

    Figure 1-26 Java Server Properties

  4. Select the module that you want to deploy.

  5. Click the Undeploy button.

 


WebLogic Enterprise EJB Deployer Properties File

This section includes the following topics:

The WebLogic Enterprise EJB Deployer stores its settings in the deployer.properties file. You can modify this file using the WebLogic Enterprise EJB Deployer, as described in Changing Preferences for the WebLogic Enterprise EJB Deployer. If you want, you can also modify many, but not all, properties using an ASCII text editor.

The WebLogic Enterprise EJB Deployer creates this file in the user's home directory. For example, on Unix, the home directory might be /home/loginName, where loginName is the user's login name. On Windows NT, this directory might be c:\winnt\profiles\loginName. If the file does not exist in the user's home directory, the WebLogic Enterprise EJB Deployer creates one with default settings automatically.

Properties Specified in the deployer.properties File

Table 1-1 describes the properties specified in the deployer.properties file.

Table 1-1 Properties Specified in the deployer.properties File

Property

Description

ejbc.compiler

Path and executable name of the Java compiler. Default setting is /java/bin/javac.exe.

ejbc.keepgenerated

Specify true to keep generated intermediate Java files, or specify false to remove them. Default setting is true.

environment.localclasspath

Optional. Path and filename to one or more additional EJB JARs that are required to load. Default setting is no path.

environment.tuxconfig

Path and filename of the tuxconfig file. Default setting is /tuxconfig.

layout.bounds

Do not edit manually. Managed internally by the WebLogic Enterprise EJB Deployer.

layout.horz-divider.location

Do not edit manually. Managed internally by the WebLogic Enterprise EJB Deployer.

layout.vert-divider.location

Do not edit manually. Managed internally by the WebLogic Enterprise EJB Deployer.

maxRecentProjects

Maximum number of entries in the list of most recently used projects under the File menu. Default setting is 5.

Sample deployer.properties File

Listing 1-2 shows a sample deployer.properties file.

Listing 1-2 Sample deployer.properties File


environment.localclasspath=e\:\\ij_51\\IcedJava\\jars\\QaDb.jar;e\:\\ij_51\\IcedJava\\jars\\qafunc.jar;e\:\\ij_51\\IcedJava\\jars\\qalib.jar
environment.tuxconfig=F\:/iceberg/samples/j2ee/ejb/basic/statefulSession/tuxconfig
ejbc.compiler=E\:/VisualCafe/Bin/SJ.exe
ejbc.keepgenerated=true
layout.bounds=0.21375,0.14166666666666666,0.5325,0.6725
layout.horz-divider.location=0.6071942446043166
layout.vert-divider.location=0.2872467222884386
maxRecentProjects=5


Note: Do not change the values of the layout.bounds, layout.horz-divider.location, or layout.vert-divider.location settings.