Oracle WebLogic Server 12c (12.2.1): Deploying the MedRec Sample Application


Options



Overview

Purpose

In this tutorial you learn to configure and deploy the Avitek Medical Records (MedRec) Sample Application to WebLogic Server 12c (12.2.1).

Time to Complete

Approximately 15 minutes.

Introduction

The MedRec sample application demonstrates aspects of the Java Platform, Enterprise Edition (Java EE) and MedRec is designed as an educational tool for all levels of Java EE developers. Configuring and deploying MedRec to WebLogic Server 12c (12.2.1) is a prerequisite for several other tutorials and this tutorial uses a single-server domain.

What Do You Need?

The following is a list of hardware and software requirements:

Starting the WebLogic Domain

  1. Open a secure shell terminal session to the Linux development machine and login as the oracle user.

  2. Change to the jrf_restricted_domain directory:
    [oracle@ol71 ~]$ cd /scratch/u01/domains/jrf_domain
  3. Execute the startWebLogic.sh script to start WebLogic Server:
    [oracle@ol71 ~]$ ./startWebLogich.sh
  4. Enter the username and password to boot WebLogic Server. The username in these tutorials is weblogic and the password is Welcome1.
    Enter username to boot WebLogic server:weblogic
    Enter password to boot WebLogic server:Welcome1
    After starting the WebLogic Server, it enters the RUNNING state:
    ...
    <Jul 30, 2015 2:20:43 PM MDT> <Notice> <WebLogicServer> <BEA-000360> <The server started in RUNNING mode.> <Jul 30, 2015 2:20:43 PM MDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING.>

    The WebLogic Server is ready for use in this tutorial.

Creating the Derby Database

  1. Open a secure shell terminal session to the Linux development machine and login as the oracle user.
  2. Change to the medrec database migration directory:
    [oracle@ol71 ~]$ cd /scratch/u01/app/fmw1221_infra/wlserver/samples/server/medrec/database-migration
  3. Edit the project.properties file:
    [oracle@ol71 ~]$ vi ../project.properties
  4. Add a line to the project.properties files to set the property db to derby:
    # --------------- infrastructure info -----------------
    
    database = derby
    db = derby
  5. Save the changes and quit the vi editor:
    # --------------- infrastructure info -----------------
    
    database = derby
    db = derby
    :wq
  6. Set your shell environment by sourcing the setExamplesEnv.sh file (the command below starts with a period and a space):
    [oracle@ol71 database-migration]$ . ../../setExamplesEnv.sh
    The script outputs that the environment has been set:
    Your environment has been set.
    [oracle@ol71 database-migration]$
  7. Execute the Ant target data.import to import the medrec application into the Derby database:
    [oracle@ol71 database-migration]$ ant data.import
    The script outputs that the build is successful:
    data.importer.run:
         [java] [EL Info]: server: 2015-07-30 14:43:23.222--Detected server platform: org.eclipse.persistence.platform.server.NoServerPlatform.
         [java] [EL Info]: server: 2015-07-30 14:43:23.299--ServerSession(1007880005)--Detected server platform: org.eclipse.persistence.platform.server.NoServerPlatform.
         [java] Jul 30, 2015 2:43:23 PM org.hibernate.validator.internal.util.Version <clinit>
         [java] INFO: HV000001: Hibernate Validator 5.1.3.Final
         [java] All the data has been imported successfully!
    
    BUILD SUCCESSFUL
    Total time: 5 seconds
    [oracle@ol71 database-migration]$

Creating the Derby Data Source

  1. Open a browser, and in the browser navigate to http://localhost:7001/console.
  2. Enter the Username and Password for this domain - this tutorial uses weblogic for the Username and welcome1 for the Password. Click Login.

    WebLogic Administration Console
    Description of this image
  3. In the Change Center pane, click Lock and Edit.

  4. In the Domain Structure pane, click Services and Data Sources.

    WebLogic Administration Console - Domain Structure Data Sources
    Description of this image

    The Summary of JDBC Data Sources displays.

    Summary of JDBC Data Sources
    Description of this image
  5. In the Summary of JDBC Data Sources, select Generic Data Source from the New drop down menu.

    Summary of JDBC Data Sources - New Generic Data Source
    Description of this image
  6. Enter MedRecGlobalDataSourceXA for Name, jdbc/MedRecGlobalDataSourceXA for JNDI Name, select Derby from the Database Type drop down menu and click Next.

    Create a New JDBC Data Source - JDBC Data Source Properties
    Description of this image
  7. From the Database Driver drop down menu, select Derby's Driver (Type 4 XA) Versions:Any and click Next.

    Create a New JDBC Data Source - Database Driver
    Description of this image
  8. Click Next.

    Create a New JDBC Data Source - Transaction Options
    Description of this image
  9. Enter medrec for Database Name, localhost for Host Name, 1527 for Port, medrec for Database User Name, medrec for Password, medrec for Confirm Password, and click Next.

    Create a New JDBC Data Source - Connection Properties
    Description of this image
  10. Click the Test Configuration button.

    Create a New JDBC Data Source - Test Configuration
    Description of this image
  11. The connection test succeeds. Click Next.

    Create a New JDBC Data Source - Test Configuration
    Description of this image
  12. In Select Targets page, click AdminServer and click Finish.

    Create a New JDBC Data Source - Select Targets
    Description of this image
  13. In the Change Center pane, click Activate Changes.

  14. The domain changes activate.

    Summary of JDBC Data Sources - changes have been activated
    Description of this image

Deploying the MedRec Sample Application

  1. In the Domain Structure pane, click Deployments.

    weblogic administration console domain structure deployments
    Description of this image
  2. In the Change Center pane, click Lock & Edit.

  3. In the Summary of Deployments pane, click Install.

    weblogic administration console summary of deployments
    Description of this image
  4. Navigate to the path that contains the medrec.ear file; this tutorial uses /scratch/u01/app/fmw1221_infra/wlserver/samples/server/medrec/dist/standalone/medrec.ear. Select the medrec.ear file and click Next.

    install application assistant locate deployment to install
    Description of this image
  5. Select Install this deployment as an application and click Next.

    install application assistant install deployment as application
    Description of this image
  6. For Available targets for medrec, select AdminServer and click Next.

    install application assistant install deployment as application
    Description of this image
  7. Enter medrec for Name and click Next.

    install application optional settings
    Description of this image
  8. Click Finish.

    install application assistant additional configuration
    Description of this image

    The deployment settings display.

    application deployment settings
    Description of this image
  9. In the Change Center panel, click Activate Changes.

    install application assistant additional configuration
    Description of this image

    The changes are activated.

    application deploymnet settings
    Description of this image
  10. In the Summary of Deployments panel, click the Control tab and select the medrec application by clicking the checkbox.

    install application assistant additional configuration
    Description of this image
  11. Click the Start button and select Servicing all requests.

    application deploymnet settings
    Description of this image
  12. In the Start Application Assistant, click Yes.

    install application assistant additional configuration
    Description of this image

    The start request is sent to the medrec deployment.

    application deploymnet settings
    Description of this image

Testing the MedRec Sample Application

  1. In the browser, navigate to the MedRec application URL, http://localhost:7001/medrec and click Getting Started!

    Welcome to the Avitek Medical Records application
    Description of this image
  2. In the Patient section of the page, click Login.

    MedRec application entrance for Administrators and Patients
    Description of this image
  3. Enter fred@golf.com for Email (if fred@golf.com is not entered by default), enter weblogic for Password, and click Sign In.

    MedRec sign in with e-mail and password.
    Description of this image
  4. In the View Record Summary section of the page, click Go.

    MedRec Patient Summary
    Description of this image
  5. The records for the current patient displays. Click Logout.

    MedRec Patient Visit Records
    Description of this image
  6. Click Logout.

    Log out of the MedRec application
    Description of this image

    The deployed MedRec sample application test is successful.

Summary

In this tutorial, you learned to:

  • Create a Derby database for the MedRec Sample Application
  • Create and Configure a JDBC Data Source for the MedRec Sample Application
  • Deploy and Test the MedRec Sample Application

Resources

Credits

Version

  • 02-34-005-DeploySampleApplication