bea.com | products | dev2dev | support | askBEA
 Download Docs   Site Map   Glossary 
Search

WebLogic Server 8.1 Upgrade Guide

 Previous Next Contents View as PDF  

Upgrading Example Applications to WebLogic Server 8.1

This appendix presents examples of application upgrades from earlier versions of WebLogic Server. It contains the following sections:

Note: WebLogic Server 8.1 examples and PetStore are configured to use the default security configuration. It is not possible to run the WebLogic Server 8.1 examples and PetStore using Compatibility security.

 


Terms Used in This Document

Where several versions of WebLogic Server are being discussed, the instructions use version-specific terms for WebLogic home directories.

In this document WL_HOME signifies a root directory of one of your WebLogic Server installations.

For 6.0 WL_HOME=D:\WLS_6.0\wlserver6.0

For 6.1 WL_HOME=D:\WLS_6.1\wlserver6.1

For 7.0 WL_HOME=D:\WLS_7.0\weblogic700

For 8.1 WL_HOME=D:\WLS_8.0\weblogic810

 


Upgrading the Pet Store Application from WebLogic Server 7.0 to WebLogic Server 8.1

The procedures described below assume that WebLogic Server 7.0 and WebLogic Server 8.1 are both installed.

The procedure involves moving your application domain to a new directory and then updating paths in the config.xml and start scripts.

You may not need to move your domain. BEA Systems recommends that application domains reside outside the WebLogic Server installation directory.

  1. Create a new directory in which to upgrade the WebLogic Server 7.0 domain to a WebLogic Server 8.1 domain. In this walkthrough, the new directory is called C:\petstorefrom70to81.
  2. From the WebLogic Server 7.0 installation, copy the WL_HOME\samples\server directory and its contents to C:\petstorefrom70to81.
  3. Open the config.xml file in C:\petstorefrom70to81\server\config\petstore. Make the following edits.
    1. Edit the application paths to point to C:\petstorefrom70to81. Replace:
    2. Path="WL_HOME\samples\server\stage\petstore\petstore.ear" TwoPhase="true">

      with:

      Path="c:\petstorefrom70to81\server\stage\petstore\petstore.ear" TwoPhase="true">

    3. For petstoreadmin.ear, opc.ear, and supplier.ear, and tour.war, likewise replace the WebLogic Server 7.1 WL_HOME path with the c:\petstorefrom70to81 path.
    4. Change the path to the Java compiler, if necessary.
  4. Open the startpetstore.cmd (or .sh) script in C:\petstorefrom70to81\server\config\petstore and make the following changes:
    1. Change %JAVA_HOME% from the JDK your WebLogic Server 7.0 installation uses to the JDK your WebLogic Server 8.1 installation uses. For example:
    2. set JAVA_HOME=WL_HOME\jdk131_03

      becomes:

      set JAVA_HOME=WL_HOME\jdk141

    3. Change %SAMPLES_HOME% from the WebLogic Server 7.0 \samples directory to the WebLogic Server 8.1 \samples directory. For example:
    4. set SAMPLES_HOME=WL_HOME\samples

      becomes:

      set SAMPLES_HOME=C:\petstorefrom70to81

    5. Change the startWLS.cmd (or .sh) path from the WebLogic Server 7.0 installation to the WebLogic Server 8.1 installation:
    6. call "C:\bea70sp1\weblogic700\server\bin\startWLS.cmd"

    7. Under JAVA_OPTIONS, change the cacerts path from the WebLogic Server 7.1 installation to the WebLogic Server 8.1 installation.
    8. -Dweblogic.security.SSL.trustedCAKeyStore=WL_HOME\server\lib\cacerts

  5. Test the upgrade by starting Pet Store using the startpetstore.cmd or .sh command, and then browse to http://localhost:7001/petstore to run the application.

 


Upgrading the Pet Store Application from WebLogic Server 6.1 Service Pack 4 to WebLogic Server 8.1

The procedures described below assume that WebLogic Server 6.1 and WebLogic Server 8.1 are both installed.

The procedure involves moving your application domain to a new directory and then updating paths in the config.xml and start scripts.

You may not need to move your domain. BEA Systems recommends that application domains reside outside the WebLogic Server installation directory.

  1. Create a new directory in which to upgrade the WebLogic Server 6.1 domain to a WebLogic Server 8.1 domain. In this walkthrough, the new directory is called C:\petstorefrom61to81.
  2. Copy these three directories and their contents from the WebLogic Server 6.1 WL_HOME directory to C:\petstorefrom61to81:

    WL_HOME\config

    WL_HOME\pstore

    WL_HOME\samples

  3. Open the config.xml file in C:\petstorefrom61to81\server\config\petstore. Make the following edits.
    1. Edit the application paths to point to C:\petstorefrom61to81. Replace:
    2. Path="WL_HOME\config\petstore\applications">

      with:

      Path="c:\petstorefrom61to81\config\petstore\applications">

      Perform this substitution for the petstore.ear and petstoreadmin.ear paths as well.

    3. For the server's RootDirectory setting, likewise replace the WebLogic Server 7.1 WL_HOME path with the c:\petstorefrom70to81 path. That is, replace:
    4. Name="petstoreServer" RootDirectory="WL_HOME"

      with

      Name="petstoreServer" RootDirectory="C:\petstore61to81"

    5. Change the path to the Java compiler, if necessary.
  4. Open the startpetstore.cmd (or .sh) script in C:\petstorefrom61to81\config\petstore and make the following changes:
    1. Remove the line:
    2. cd ..\..

    3. Change %JAVA_HOME% from the JDK your WebLogic Server 7.0 installation uses to the JDK your WebLogic Server 8.1 installation uses. For example:
    4. set JAVA_HOME=WL_HOME\jdk131

      becomes:

      set JAVA_HOME=WL_HOME\jdk141

    5. Change %BEA_HOME% from the WebLogic Server 6.1 home directory to the WebLogic Server 8.1 home directory.
    6. Edit the line that checks which directory contains the script from:
    7. if not exist lib\weblogic.jar goto wrongplace

      to read:

      if not exist C:\bea81Dec4beta\weblogic81b\server\lib\weblogic.jar goto wrongplace

    8. Change the classpath from
    9. set CLASSPATH=.;.\lib\weblogic_sp.jar;.\lib\weblogic.jar;.WL_HOME61\samples\eval\cloudscape\lib\cloudscape.jar;.\config\petStore\serverclasses

      to

      set CLASSPATH=.;WL_HOME81\server\lib\weblogic.jar;.C:\petstorefrom61to81\samples\eval\cloudscape\lib\cloudscape.jar;C:\petstorefrom61to81\config\petstore\serverclasses

  5. Test the upgrade by starting Pet Store using the startpetstore.cmd or .sh command, and then browse to http://localhost:7001/estore to run the application.

 


Upgrading the Banking Application from WebLogic Server 5.1 to WebLogic Server 8.1

This example shows a successful upgrade from WebLogic Server 5.1 to WebLogic Server 8.1. The following example assumes an application running on WebLogic Server 5.1 SP12. The example is a simple banking application.

The following two main steps will migrate the banking application from WebLogic Server 5.1 to WebLogic Server 8.1:

Convert the weblogic.properties File

Use the WebLogic 8.1 Administration Console to convert the WebLogic Server 5.1 application's weblogic.properties file.

  1. Launch the WebLogic Server 8.1 Examples Server from Start | Programs | BEA WebLogic Platform 8.1 Server | WebLogic Server 8.1 | Server Tour and Examples | Launch Examples Server.
  2. Go to the Administration Console page. On the WebLogic Server Examples page that the Examples Server launches, click the Administration Console link. You will have to login with a username and password.
  3. In the Administration Console, click "Convert weblogic.properties" to go to the converter. This conversion will write the properties in your WebLogic Server 5.1 weblogic.properties file to XML files for WebLogic Server 8.1 to use in a domain. (For more information about Domains in WebLogic Server, see WebLogic Server Configuration Reference.)
  4. In the first page of the "Convert weblogic.properties" path ("Step 1 - Locate weblogic root"), browse to select the directory that contains the weblogic.properties file.

    The second page of the "Convert weblogic.properties" path appears.


     

  5. From a list of available application directories, select the directories that contain your application. The weblogic.properties converter will convert these directories into a WebLogic Server 8.1 domain.
  6. Fill in the remaining text fields.
    1. Admin Server Name (migrationserver)
    2. Output Directory (c:\banco)
    3. WebLogic Home
    4. Name for New Domain (migrationdomain)
  7. Click Convert.

If the conversion is successful, a page will appear with a message something like the following:

New Domain name is migrationdomain
*************************************
Server Name is migrationserver
This server doesn't belong to any cluster 
*************************************
Converting Server properties
Converting Server Debug Properties
Converting WebServer properties
Converting WebApp Component Properties
Converting JDBC Specific properties
Converting CORBA IIOP properties
Converting EJB Specific Properties
--- Warning Source File D:\510sp12\migrationserver\app_banking.jar does not exist copy the correct file manually after conversion to C:\banco\applications
Converting StartupClass properties
Converting Shutdown Class properties
Converting MailSession Properties 
Converting FileT3 properties
Converting JMS properties
Converting Security Properties 
Converting the PasswordPolicy properties
Converting User Group and ACL properties
Creating webApp for the servlets registerd in the properties file
Startup Scripts for the Server are created in the ResultDir C:\banco
Conversion successful. 

Configure the Banking Application for WebLogic Server 8.1

To deploy and run the banking application on WebLogic Server 8.1:

Edit the startmigration Script

The weblogic.properties converter generated a script for starting up the banking application's domain. Specify some additional variables to run the banking application in this domain.

  1. Edit the startmigrationdomain script, adding the following variables:

    set APPLICATIONS=%WL51_HOME%\config\migrationdomain\applications

    set CLIENT_CLASSES=%WL51_HOME%\config\migrationdomain\clientclasses

    set SERVER_CLASSES=%WL51_HOME%\config\migrationdomain\serverclasses

    set BANKING_WEBAPP_CLASSES=D:\banking\510sp12\migrationserver\serverclasses\examples\tutorials\migration\banking

    set CLOUDSCAPE_CLASSES=%WL51_HOME%\samples\eval\cloudscape\lib\cloudscape.jar

  2. Append these variables to the startmigrationdomain CLASSPATH:

    CLASSPATH=...%APPLICATIONS%;%CLIENT_CLASSES%;%SERVER_CLASSES%;%BANKING_WEBAPP_CLASSES%;%CLOUDSCAPE_CLASSES%

  3. Add the following setting to the startmigrationdomain script, making sure to add it before the final weblogic.Server:

    -Dcloudscape.system.home=WL51_HOME\eval\cloudscape\data

Copy Banking Application Files to the Output Directory

Copy the application jar file and the web application classes and files to the banking directory.

Copy AccountDetail.jsp, error.jsp, login.html to C:\banco\applications\DefaultWebApp_migrationserver.

  1. Copy app_banking.jar to C:\banco\applications\.
  2. Copy AccountDetail.jsp, error.jsp, login.html to C:\banco\applications\DefaultWebApp_migrationserver.
  3. Copy BankAppServlet.class into C:\banco\applications\DefaultWebApp_migrationserver\WEB-INF\classes.

Deploy and Run the Banking Application

Start the application by navigating to c:\banco\ in a command console and entering the command startmigration.

See the application at http://localhost:7001/banking.

Use:

username:system

password:password

account 1000

 

Back to Top Previous Next