Oracle WebLogic Server 12c (12.2.1): Configuring a Single Domain Partition


Options



Before You Begin

Purpose

Configuring a Single Domain Partition uses WebLogic 12c (12.2.1) Multitenancy for several benefits:

  • Separation between the Administrative Domain and Application Domain Partition - for Security Realms, JDBC Data Sources, JMS services, and other application services
  • Management and Monitoring for Application Domain Partition components
  • Use Virtual Targets to service the Application Domain Partition using another host and port

Time to Complete

Approximately 30 minutes.

Introduction

The sample Avitek Medical Records application (MedRec) is used in this tutorial - the MedRec application is a web front-end on a Derby database back-end, and it is configured to be deployed using a Resource Group Template.

The high-level process in this tutorial for configuring an application for WebLogic 12c (12.2.1) Multitenancy includes:

  • Creating the Resource Group Template
    • A Resource Group Template is a collection of deployable resources to be used as a template; for the MedRec application in this tutorial, the Resource Group Template includes the medrec.ear and the JDBC Data Source
  • Creating the Security Realm
    • A Domain Partition can use the Domain Security Realm, or a different Security Realm; in this tutorial, the Domain Partition uses a different Security Realm to enable a different set of users to administrate the Domain Partition
  • Creating the Virtual Target
    • In this tutorial, the MedRec application uses the localhost address and port 9999.
  • Creating the Domain Partition
    • The Domain Parition in this tutorial is the realization of the Resource Group Template, custom Security Realm, and Virtual Target - creating a specific instance of the MedRec sample application.

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_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 the server enters the RUNNING state, it is ready for this tutorial.

    ...
    The server started in RUNNING mode.
    ...

Deleting an Application and JDBC Data Source

If the MedRec sample application and JDBC Data Source still deployed as a result of the prerequisite tutorial, delete them from the domain; later steps in this tutorial will deploy MedRec and its JDBC Data Source in a Domain Partition.

  1. Open a web browser on the Linux development machine - this tutorial uses Firefox.

  2. In the browser navigate to http://localhost:7001/em.

  3. Enter the administrator Username and Password (in the prerequisite tutorial the Username weblogic and Password Welcome1 were used) and click Login.

    alternate text
    Description of this image

    The Fusion Middleware Control 12c domain home page displays.

    alternate text
    Description of this image
  4. This domain is running in production mode, so configuration changes are managed by the Change Center. In the Change Center menu, select Lock & Edit.

    alternate text
    Description of this image

    The confirmation of the edit session lock displays.

    alternate text
    Description of this image
  5. To delete the current medrec application deployment, select Deployments from the WebLogic Domain menu.

    alternate text
    Description of this image

    The Deployments page displays.

    alternate text
    Description of this image
  6. In the Deployments page, select the current medrec deployment, click the Control menu, click Stop and click Force stop now.

    alternate text
    Description of this image
  7. In the Confirmation dialog box, click Stop.

    alternate text
    Description of this image

    The confirmation message to stop the deployment displays.

    alternate text
    Description of this image
  8. In the Deployments page, click the medrec deployment, click the Deployment menu and select Undeploy.

      alternate text
    Description of this image
  9. In the Confirmation page, click Undeploy.

    alternate text
    Description of this image
  10. In the Undeployment Succeeded dialog box, click Close.

    alternate text
    Description of this image

    The updated Deployments page displays.

      alternate text
    Description of this image
  11. To delete the current medrec JDBC Data Sources, select JDBC Data Sources from the WebLogic Domain menu.

    alternate text
    Description of this image

    The JDBC Data Sources page displays.

    alternate text
    Description of this image
  12. In the JDBC Data Sources page, click the MedRecGlobalDataSourceXA table entry and click Delete.

    alternate text
    Description of this image
  13. In the Confirm Data Source Deletion dialog box, click OK.

    alternate text
    Description of this image

    The confirmation message displays.

    alternate text
    Description of this image
  14. From the Change Center menu, select Activate Changes.

    alternate text
    Description of this image

    The confirmation message displays that the changes have been activated.

    alternate text
    Description of this image

Enabling the Lifecycle Manager

Working with multitenancy and domain partitions requires that the Lifecycle Manager is enabled in a WebLogic Server 12.2.1 domain. If the Lifecycle Manager is not enabled, enable the Lifecycle Manager and restart the WebLogic Administration Server.

  1. From the WebLogic Domain menu select Environment and then select Domain Partitions.

    alternate text
    Description of this image
  2. If the Domain Partitions page displays a message that the Lifecycle Manager services are not available, click Enable Lifecycle Manager.

    alternate text
    Description of this image

    The confirmation displays.

    alternate text
    Description of this image
  3. To stop the WebLogic Administration Server, click the WebLogic Domain menu, select Environment and select Servers.

    alternate text
    Description of this image
  4. Click the AdminServer table entry.

    alternate text
    Description of this image
  5. Click the Control menu, then click Shutdown, and click Force Shutdown Now.

    alternate text
    Description of this image
  6. In the Forcibly Shutdown Servers dialog box, click Forcibly Shutdown Servers.

    alternate text
    Description of this image

    The Forcibly Shutdown Servers dialog box displays a message to relogin after the AdminServer has been restarted.

    alternate text
    Description of this image
  7. Open a secure shell terminal session to the Linux development machine and login as the oracle user.

  8. Change to the jrf_domain directory:
    [oracle@ol71 ~]$ cd /scratch/u01/domains/jrf_domain
  9. Execute the startWebLogic.sh script to start WebLogic Server:
    [oracle@ol71 ~]$ ./startWebLogich.sh
  10. 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 the server enters the RUNNING state, it is ready to continue this tutorial.

    ...
    The server started in RUNNING mode.
    ...
  11. Back in the web browser, in the Forcibly Shutdown Servers dialog box, click Relogin.

    alternate text
    Description of this image
  12. The Fusion Middleware Control 12c login page displays. top the adminserver. Enter the administrator Username and Password (in the prerequisite tutorial the Username weblogic and Password Welcome1 were used) and click Login.

    alternate text
    Description of this image

Creating the Resource Group Template

  1. From the WebLogic Domain menu, click Environment, and then click Resource Group Templates.

    alternate text
    Description of this image

    The Resource Group Templates page displays.

    alternate text
    Description of this image
  2. From the Change Control menu, select Lock & Edit.

    alternate text
    Description of this image

    The edit session lock confirmation message displays.

    alternate text
    Description of this image
  3. In the Resource Group Templates page, click Create.

    alternate text
    Description of this image
  4. In the Create a Resource Group Template dialog box, enter MedRecRGT for Name and click Create.

    alternate text
    Description of this image
  5. The confirmation of the resource group template creation displays. Click the MedRecRGT table entry.

    alternate text
    Description of this image
  6. In the Resource Group Template : MedRecRGT page, click the Deployments tab.

    alternate text
    Description of this image
  7. The Deployments tab displays.
    alternate text
    Description of this image
  8. In the Resource Group Template : MedRecRGT page, click the Deployment menu, and select Deploy.

    alternate text
    Description of this image
  9. In the Deploy Java EE Application: Select Archivereate a Resource Group Template page, click Archive or exploded directory is on the server where Enterprise Manager is running. Click Browse... and select the file at /scratch/u01/app/fmw1221_infra/wlserver/samples/server/medrec/dist/standalone/medrec.ear and click Next.

    alternate text
    Description of this image
  10. Review the application attributes and click Next.

    alternate text
    Description of this image
  11. Review the deployment settings and click Deploy.

    alternate text
    Description of this image
  12. In the Deployment Succeeded dialog box,click Close.

    alternate text
    Description of this image
  13. The updated Deployments tab displays. Click Services.

    alternate text
    Description of this image
  14. In the Resource Group Template : MedRecGT page, in the Services tab, click Create and select Generic Data Source.

    alternate text
    Description of this image
  15. In the Data Source Name field, enter MedRecGlobalDataSourceXA. In the JNDI Name field, enter jdbc/MedRecGlobalDataSourceXA. Next to the Driver Class Name field, click Select...

    alternate text
    Description of this image
  16. From the Database Type drop down menu, select Derby and click OK.

    alternate text
    Description of this image
  17. Click Next.

    alternate text
    Description of this image
  18. Click the Generate URL and Properties... button.

    alternate text
    Description of this image
  19. In the Generate URL reate dialog, enter the following values and click OK:

    • Database Host Name: localhost
    • Database Listener Port: 1527
    • Database Name: medrec
    • Database User Name: medrec
    • Password: medrec
    • Confirm Password: medrec
    alternate text
    Description of this image
  20. Review the connection properties and click Test Database Connection.

    alternate text
    Description of this image
  21. In the Confirmation dialog box, click OK.

    alternate text
    Description of this image
  22. In the Create a JDBC Data Source: Connection Properties page, click Next.

  23. In the Create a JDBC Data Source: Transaction Properties page, click Next.

    alternate text
    Description of this image
  24. Review the settings for the JDBC Data Source and click Create.

    alternate text
    Description of this image

    The confirmation for the new JDBC Data Source displays.

    alternate text
    Description of this image

Creating a Security Realm and the MedRec Administrator User

  1. From the WebLogic Domain drop down menu, select Security and then Security Realms.

    alternate text
    Description of this image
  2. The security realms display. Click Create.

    alternate text
    Description of this image
  3. Enter MedRecRealm for Name and click Create.

    alternate text
    Description of this image

    The confirmation for the new security realm displays.

    alternate text
    Description of this image
  4. From the Change Center drop down menu, select Activate Changes.

    alternate text
    Description of this image
  5. The confirmation for the activation changes displays.

    alternate text
    Description of this image
  6. From the WebLogic Domain menu, select Security and then select Users and Groups.

    alternate text
    Description of this image
  7. In the Users and Groups page, select MedRecRealm from the Select a Realm drop down menu.

    alternate text
    Description of this image
  8. In the Users and Groups page, click Create.

    alternate text
    Description of this image
  9. In the Create a New User dialog box, enter administrator for Name, enter a Password, Confirm Password and click Create. 

    alternate text
    Description of this image

    The medrec administrator user is created.

    alternate text
    Description of this image

Creating a Virtual Target

  1. From the WebLogic Domain drop down menu select Environment and Virtual Targets.

    alternate text
    Description of this image

    The Virtual Targets page displays.

    alternate text
    Description of this image
  2. From the Change Center drop down menu, select Lock & Edit.

    alternate text
    Description of this image

    The confirmation message for the edit session lock displays.

    alternate text
    Description of this image
  3. In the Virtual Targets page, click Create.

    alternate text
    Description of this image
  4. Enter MecRecVT for Name, enter /medrecvt for Uri Prefix, and click Next.

    alternate text
    Description of this image
  5. Select AdminServer for the Server drop down menu and click Create.

    alternate text
    Description of this image
  6. The virtual target is created successfully.

    alternate text
    Description of this image
  7. From the Change Center drop down menu, select Activate Changes.

    alternate text
    Description of this image

    The confirmation for the change activation displays.

    alternate text
    Description of this image

Creating a Domain Partition

  1. From the WebLogic Domain drop down menu select Environment and Domain Partitions.

    alternate text
    Description of this image
  2. The Domain Partitions page displays. Click Create.

    alternate text
    Description of this image
  3. Enter MedRecPartition for Name, select MedRecRealm for Security Realm and click Next.

    alternate text
    Description of this image
  4. Click to select the MedRecVT virtual target, click Set as Default, and click Next.

    alternate text
    Description of this image
  5. Enter MedRecRG for Resource Group Name, select MedRecRGT for Resource Group Template, shuttle the MedRecVT to Selected Targets, and click Next.

    alternate text
    Description of this image
  6. Review the Create Domain Partition: Summary and click Create.

    alternate text
    Description of this image

    The domain partition MedRecPartition is created. Note that the confirmation message indicates that the Administration server must be restarted for the changes to take effect.

    alternate text
    Description of this image
  7. To stop the WebLogic Administration Server, click the WebLogic Domain menu, select Environment and select Servers.

    alternate text
    Description of this image
  8. Click the AdminServer table entry.

    alternate text
    Description of this image
  9. Click the Control menu, then click Shutdown, and click Force Shutdown Now.

    alternate text
    Description of this image
  10. In the Forcibly Shutdown Servers dialog box, click Forcibly Shutdown Servers.

    alternate text
    Description of this image

    The Forcibly Shutdown Servers dialog box displays a message to relogin after the AdminServer has been restarted.

    alternate text
    Description of this image
  11. Open a secure shell terminal session to the Linux development machine and login as the oracle user.

  12. Change to the jrf_domain directory:
    [oracle@ol71 ~]$ cd /scratch/u01/domains/jrf_domain
  13. Execute the startWebLogic.sh script to start WebLogic Server:
    [oracle@ol71 ~]$ ./startWebLogich.sh
  14. 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 the server enters the RUNNING state, it is ready to continue this tutorial.

    ...
    The server started in RUNNING mode.
    ...
  15. Back in the web browser, in the Forcibly Shutdown Servers dialog box, click Relogin.

    alternate text
    Description of this image
  16. The Fusion Middleware Control 12c login page displays. top the adminserver. Enter the administrator Username and Password (in the prerequisite tutorial the Username weblogic and Password Welcome1 were used) and click Login.

    alternate text
    Description of this image

Starting a Domain Partition

  1. In the WebLogic Domain home page, click Domain Partitions.

    alternate text
    Description of this image

    The list of domain partitions displays.

    alternate text
    Description of this image
  2. Click the table entry for the MedRecPartition and select Start from the Control drop down menu.

    alternate text
    Description of this image
  3. In the Confirmation dialog box, click Close.

    alternate text
    Description of this image

Testing the Avitek Medical Records Application in a Domain Partition

  1. In the browser, navigate to http://localhost:7001/medrecvt/medrec; the welcome page for the Avitek Medical Records application displays.Click Getting Started!

    alternate text
    Description of this image
  2. From the Patient section of the page, click Login.

    alternate text
    Description of this image
  3. If the email is not already entered, enter fred@golf.com for Email, enter weblogic for Password, and click Sign In.

    alternate text
    Description of this image
  4. Click Go in the View Record Summary section of the page.

    alternate text
    Description of this image
  5. The Visit Records for the user Fred displays. Click Logout.

    alternate text
    Description of this image
  6. Click Logout.

    alternate text
    Description of this image
  7. From the Administrator section of the page, click Login.

    alternate text
    Description of this image
  8. Enter administrator for Username, enter the password you used to create the administrator user in the MedRecRealm for Password, and click Sign In.

    alternate text
    Description of this image
  9. Click Go in the Pending Requests section of the page.

    alternate text
    Description of this image
  10. The pending requests for this medrec application instance displays. Click Logout.

    alternate text
    Description of this image
  11. Click Logout.

    alternate text
    Description of this image
  12. The WebLogic Server Single Domain Partition tutorial is complete - the Avitek Medical Records sample application is now running in a WebLogic Server domain parition.

Want to Learn More?

In this tutorial, you learned to:

  • Configure WebLogic Server 12c (12.2.1) with a Domain Partition
  • Deploy and Test the MedRec Application into a Domain Partition

Resources

Credits

Version

  • 02-35-006-SinglePartition