Quick Start Guide to the Deployment Toolkit for WebSphere Studio, WebLogic Edition

This provides instructions for deploying EJBs on a BEA WebLogic Server when using the Deployment Toolkit for WebSphere Studio, WebLogic Edition feature.

Table of contents

1) Prerequisites for the Deployment Toolkit for WebSphere Studio, WebLogic Edition Feature

2) Steps Required Prior to Starting WebSphere Studio Application Developer

3) Installing the Deployment Toolkit for WebSphere Studio, WebLogic Edition Feature

4) Customize the BEA WebLogic Server Preferences

5) Create an EJB Project

6) Create an EJB

7) Enable EJB Project for BEA WebLogic Server

8) Update Deployment Descriptors

9) Create Database schema and tables

10) Create a Domain configuration

11) Create a Server and a Server configuration

12) Define a Connection Pool and Data Source

13) Associate the EAR file with the Server Configuration

14) Running and Testing an Enterprise Java Bean

15) Known Issues

1) Prerequisites for the Deployment Toolkit for WebSphere Studio, WebLogic Edition Feature

  1. WebSphere Studio Application Developer 5.0.1.
  2. Deployment Toolkit for WebShpere Studio, WebLogic Edition 5.0.0.
  3. BEA WebLogic Server 6.1 SP4 and/or 7.0 SP1. This must be installed locally even if the target deployment server is not local.
  4. Windows 2000 or Windows XP

2) Steps Required Prior to Starting WebSphere Studio Application Developer

  1. Add the BEA WebLogic Server JDK to your path environment variable (for example, C:\bea\jdk131_06 \bin).
  2. For DB2 database users, update the path environment variable if not already set (for example, add "C:\Program Files\SQLLIB\bin" and "C:\Program Files\SQLLIB\java").

3) Installing the Deployment Toolkit for WebSphere Studio, WebLogic Edition Feature

  1. Start WebSphere Studio Application Developer and switch to the Install/Update perspective (Help > Software Updates > Update Manager). You will be using either the IBM WebSphere Studio Application Developer Discovery site or an update site from a zip file to locate and install the Deployment Toolkit for WebSphere Studio, WebLogic Edition feature.
  2. Locate the Deployment Toolkit for WebSphere Studio, WebLogic Edition feature in the update site. If you are using the Discovery site, expand the Sites to Visit node in the Feature Updates view until you find the category named Deployment Toolkit for WebSphere Studio, WebLogic Edition. If you are using an update site created from a zip file, use the Feature Updates view to browse the file system for the category named Deployment Toolkit for WebSphere Studio, WebLogic Edition.
    In this category will be the current version of the feature that can be installed.
  3. Select the feature under the category, and then in the Preview view you can use links to review the license, description, and from the description the readme associated with this feature.
  4. Select Install in the Preview view to start the process of installing the feature.
  5. Review and then accept the license that is shown. It must be accepted to complete the install.
    Select Next to continue to the next page.
  6. Select Finish to start the install process.
  7. The Feature verification page will identify that the JAR files on the install site have not been signed, this is expected. Select Install to complete the install processing. Allow WebSphere Studio Application Developer to restart when prompted.

4) Customize the BEA WebLogic Server Preferences

  1. After WebSphere Studio Application Developer has restarted, you can set the preferences for the BEA WebLogic Server. Use Window > Preferences > Server > BEA WebLogic to open the preferences page and enter the appropriate values:

5) Create an EJB Project

  1. Switch to the J2EE perspective.
  2. Select File > New > EJB Project or click the icon .
  3. Select Create 2.0 EJB Project and then select Next.
  4. Enter an EJB project name. Use the default EAR project name setting or define one of your own.
  5. Click Finish to complete the EJB project creation.
  6. After creating an EJB project, it is recommended that you turn off automatic validation due to performance issues.
  7. Close any deployment descriptor editors before creating/modifying EJBs (There are known issues with not receiving notifications when the editor is open, for example, for weblogic-ejb-jar.xml, weblogic-cmp-rdbms-jar.xml).

6) Create an EJB

  1. Select File > New > Enterprise Bean to create a bean or click the icon .

Create a Session Bean:

  1. Select Session Bean. Enter the Bean name.
  2. Define com.ibm.test as a default package.
  3. Click Finish to complete the Session Bean creation.

Create a CMP 2.0 bean:

  1. Select Entity bean with container-managed persistence (CMP) fields. Select CMP 2.0 Bean. Enter the Bean name, define com.ibm.test as a default package.
  2. Select the Local client view check box. Select the Remote client view check box if required. The remote interface defines the business methods that can be called by a client.
  3. Add persistence fields to the bean. Select the Key field check box, if the attribute created is defined as the key field. Click Finish to complete the CMP bean creation.

7) Enable EJB Project for BEA WebLogic Server

  1. In the J2EE hierarchy view, right-click on the EJB Project, and select the Enable For WebLogic Server menu item.
  2. Select version 7.0 or version 6.1 depending on your target application server. A folder wls70 or wls61 is created containing the deployment descriptors specific to BEA WebLogic Server.
  3. Right-click on the EJB Project and select the menu item Run validation to invoke the ejbc tool to validate and generate code. The console should display ejbc successful.

8) Update Deployment Descriptors

  1. In the J2EE hierarchy view, right-click on the EJB Project, and then select Edit WebLogic EJB to RDB Mapping.
  2. Select the CMP bean and enter a data source name Test.
  3. In the J2EE hierarchy view, right-click on the EJB Project, and then select Open With Deployment Descriptor Editor.
  4. Select the WebLogic 6.1 or WebLogic 7.0 tab depending on your application server target.
  5. Enter the Bean's JNDI name. The JNDI name field is the value you will use for look-ups in the Universal Test Client. Those values should already be populated.

9) Create Database schema and tables

  1. Run the DDL script against your target database to create the tables and associations.

10) Create a Domain configuration

  1. Go to Programs > BEA WebLogic Platform 7.0 and select Domain Configuration Wizard. Refer to the WebLogic documentation for information on creating WebLogic 6.1 domains.
  2. Select the template WLS Domain.
  3. Enter a domain name testdomain, and then click Next.
  4. Select Single Server, and then click Next
  5. Select C:\bea\user_projects\ as the domain directory, and then click Next.
  6. Enter a server name testserver, and then click Next.
  7. Enter an Admin user name and a password and proceed to create the domain.

11) Create a Server and a Server configuration

  1. Switch to the Server perspective.
  2. From the main menu, select File > New > Server and Server Configuration to open the Create a New Server and Server Configuration wizard.
  3. In the Server Name field, type Server.
  4. In the Folder field, select Servers from the drop-down list.
  5. In the Server type list box, expand BEA WebLogic Server 7.0 (or 6.1) and select Local Server or Remote Server Attach if you’re planning on running on a remote server. Click Next.
  6. Enter an Admin username and a Password, and then click Next.
  7. Enter the domain name testdomain. The server name testserver should appear.
  8. Click Finish to create the server.

12) Define a Connection Pool and Data Source

  1. Open the server Server editor and select the Classpath tab .
  2. For DB2 users, add C:\Program Files\SQLLIB\Java\db2java.zip to the classpath for the server you are running.
  3. Start the server called Server.
  4. Once the server is started, click Launch server console from the server editor under the Server tab.
  5. Enter the Admin user name and password defined previously.
  6. Under Services Configurations, select Connection Pools to configure a new connection pool as shown below. In the example the database is DB2 and the database name is SAMPLE.

  1. Click Create and then select the Targets tab to enable the connection pool testPool for the target server testserver.
  2. Select Tx Data Sources to configure a new JDBC TX Data Source.
  3. The data source name field in the EJB to RDB Mapping deployment descriptor defined in step 9) must match the JNDI name of the data source defined below.

 

  1. Click Create and then select the Targets tab to enable the TX Data Source Test for the target connection pool testPool.
  2. Close the Server Console Admin.

13) Associate the EAR file with the Server Configuration

  1. In the Server Configuration view, expand Server Configuration and then right-click on WLS Server Configuration.
  2. Select Add and click the default EAR file to associate it with the server configuration.

14) Running and Testing an Enterprise Java Bean

  1. In the J2EE hierarchy view, right-click on the EJB Project and select Run on server. This will start the WLS server and launch the EJB Test Client. There is no need to generate deploy code in the Run on server step for EJB projects since validation already generated the deploy code.
  2. Change to the JNDI Explorer page and enter the JNDI name for the session bean and/or CMP bean to perform a Lookup.

15) Known Issues

This list contains known issues and limitations at release time. Bug tracking ids follow in brackets [].

  1. Server configurations: Reusing WebLogic domains for server configurations or sharing domains among more than one server configuration is not recommended, as it will cause publishing and deployment problems. [1737]
  2. Server configurations: Using the WebLogic administration console to remove applications deployed with WebSphere Studio will cause publishing and deployment problems. [1655]
  3. Model synchronization: EJB Deployment Descriptor editors and WebLogic CMP to RDB Mapping editors must be closed before exiting WebSphere Studio to avoid model synchronization problems on the next workbench startup. [1645]
  4. Model synchronization: Changes made in the Deployment Descriptor editors that affect WebLogic-specific descriptors take effect immediately and cannot be reverted. If the user does not save the changes, the descriptor contents will be inconsistent. [1660]
  5. Model synchronization: EJB Deployment Descriptor editors and WebLogic CMP to RDB Mapping editors sometimes open in the dirty state. This indicates that the model loaded in memory has been modified in some way. Save the editor to avoid any potential model synchronization problems. [1647, 2490]
  6. Model synchronization: An open WebLogic CMP to RDB Mapping editor may not refresh its contents in all update scenarios, in particular, when adding beans and CMP fields from the J2EE Hierarchy view while the editor is open. [2517]
  7. Model synchronization: Adding and removing beans from an EJB module may fail to synchronize the WebLogic-specific descriptors if the enterprise application has been recently removed from a server configuration. [3400, 3453, 3454]
  8. CMP: Use of CMP 1.1 and CMP 2.0 in the same EJB module requires manual editing of the descriptors. This affects validation, import/export, deployment, and a number of other areas. Follow the instructions for using CMP 1.1 entity beans in an EJB 2.0 module in the online help. [1086, 1215, 1642, 1728]
  9. UTC: Local home interface lookup doesn’t work in the Universal Test Client. [1631]
  10. UTC: If the server is republished while the Web browser is open to the Universal Test Client, it must be reinitialized by performing a Run on Server or manually setting the JNDI properties. [2362]
  11. UTC: Run on Server of a Enterprise Bean does not automatically lookup the bean in the JNDI Explorer. [1181]
  12. Server configuration publisher: The server synchronization state will still read Needs to be Republished if a change is made to a project that is associated with a server configuration. The state only changes if the server configuration itself needs to be republished. [1156]
  13. Server configuration publisher: The server publish preferences should be set to use Publish All or Smart Publish. Prompt user publishing method does not work. [2670]
  14. Run on server: Wizard may freeze if you choose to create new server and server configuration after pressing Finish. [1153]
  15. Server and server configuration wizard: Finish button is incorrectly enabled after completing the server wizard page, allowing you to skip the required entry of the WebLogic domain for the server configuration. [1229]
  16. Server resource editors: Cannot see undo action results in port number fields if the previous value was invalid. [1652]
  17. Server configuration validation: Server projects need to auto-validate in order for the WebLogic Server Configuration Validator to provide useful warning messages when applications are not fully enabled for WLS. [1740]
  18. WAS EJB 1.1 relationships: Creating WAS EJB 1.1 relationships in a WebLogic-enabled EJB project will cause resource save problems. [2331]
  19. EJB 2.0 relationships: Relation with two identical relationship role names is allowed. [1643]
  20. YourCo scenario may have problems with a TLD. To resolve the problem edit the taglib.tld file inWEB-INF/lib/jspsql.jar, removing all the empty <teiclass> tags. Re-package and re-deploy the application. [2347]
  21. Server configuration publisher: Unable to deploy application because of FileNotFoundException META-INF/ejb-jar.xml not found in jar. Actually caused by concurrent access problem when a deploy, redeploy, or undeploy action is interrupted by another action or a shutdown. [1639, 1700]
  22. Server startup: WebLogic Server 6.1 stays in "Starting" state and never progresses to "Started" on Windows NT. Upgrade to WebLogic Server 6.1 SP4.
  23. Server startup: An UnavailableException may occur when the server is started if a client attempts to access the web container before it is fully initialized. May cause problems for Run on Server which causes a server restart. A subsequent Run on Server should succeed. [2446]

© Copyright International Business Machines Corporation, 2000, 2003.
All rights reserved.

Copyright 2003 © BEA Systems, Inc. All rights reserved

Other company, product, and service names may be trademarks or service marks of others.