Thursday, October 23, 2014

WebLogic: How to Create a WLS Domain?

In WebLogic Server, you can create a domain using:[1]
  • WebLogic Configuration Wizard
  • WLST
  • weblogic.Server (a command-line utility)
Your actual choice of a domain creation tool depends on whether you prefer a graphical or command-line interface, and whether you need to automate the domain creation process. Using above-mentioned tools, you can either create a domain or extend an existing domain.

In this article, we will look at two ways to create a WebLogic domain:
  • Creating a new domain based on an existing domain
  • Creating a new domain based on a domain template

Domain Template


A template is simply a jar file that contains the necessary scripts and files WebLogic Server needs to create or extend domains.

There are three basic types of templates in WebLogic Server:[1]
  • Domain Templates
    • Help create an entire domain
      • Defines the full set of resources within a WebLogic domain, including:
        • Infrastructure components
        • Applications
        • Services
        • Security options
        • General environment and operating system options.
  • Extension Templates
    • Add to the functionality of a domain
      • Oracle uses special extension templates for various Fusion Middleware products.
  • Managed Server Templates
    • Defines the subset of resources within a WebLogic domain that are required to create a Managed Server domain directory on a remote machine. 
You can create the first two types of templates with the Domain Template Builder,[2] and you can create all three types with the pack utility.[3]

Creating a New Domain Based on an Existing Domain


Follow these steps to create a new domain using WLST offline commands:
  1. Execute the readDomain command to open an existing WebLogic domain
    • wls:/offline>readDomain('C:/Oracle/Middleware/user_projects/domains/base_domain')
    • wls:/offline/base_domain>
  2. Execute the writeTemplate command to write the current domain configuration to a specific domain template.
    • wls:/offline/base_domain>writeTemplate('C:/Oracle/Middleware/user_templates/MyBaseTemplate.jar')
    • wls:/offline/base_domain>
  3. Execute the closeDomain command to close it
    • wls:/offline/base_domain>closeTemplate()
    • wls:/offline/base_domain>
  4. Execute writeDomain command to create a new domain
    • wls:/offline/base_domain>createDomain('C:/Oracle/Middleware/user_templates/ws_server_12.1.2.0.jar', 'C:/Oracle/Middleware/user_projects/domains/my_domain1','weblogic','welcome1')
    • wls:/offline/base_domain>
You won’t receive any confirmation that the domain has been created, but the absence of any error messages means that the domain was successfully created. Note that the createDomain WLST command works essentially the same as the unpack command.[3]

Creating a New Domain Based on a Domain Template


Probably the easiest way to create a domain is through the Configuration Wizard. The Configuration Wizard uses default templates to create or extend an existing domain.

Follow these steps to create a new domain using Configuration Wizard on Windows:[1,7,8]
  1. Click the Windows shortcut at Start | Programs | Oracle | OracleHome | WebLogic Server 12c | Tools | Configuration Wizard
  2. Select Create A New Domain On the Create Domain screen
  3. Choose one of the following two options on the Templates screen
    • Create Domain Using Product Templates
    • Create Domain Using Custom Template
  4. Specify the login credentials for this new domain on the Administrator Account screen
  5. Configure startup mode and JDK on the Domain Mode And JDK screen
  6. Configure the database schemas on the Configure JDBC Data Sources screen
  7. Specify keystore password on the Configure Keystore Credentials screen
  8. Perform certain advanced configuration tasks on the Advanced Configuration screen
  9. Review your domain configuration settings on the Configuration Summary screen
  10. Check Configuration Progress and Status
You can use Configuration Wizard to create a domain with just an Admin Server or a domain that includes additional Managed Servers or even a cluster. In addition, you can customize a domain by configuring JDBC settings, for example, to point to a different database rather than the default database (Apache Derby database) used by the domain and extension templates.

Avitek Medical Records Sample Domain


Avitek Medical Records Sample Domain Template is one of the WebLogic domain templates that are provided with your WebLogic Server installation.[5] You can use it to extend the basic WebLogic Server domain, which creates the Avitek Medical Records sample domain.

This domain is a WebLogic Server sample application suite that demonstrates all aspects of the J2EE platform. Read [5] to view the details of generated domain output.

References

  1. Oracle WebLogic Server 12c Administration Handbook
  2. Using the Domain Template Builder to Create Domain Templates
  3. Overview of the Pack and Unpack Commands
  4. WebLogic Server Templates (12c)
  5. Avitek Medical Records Sample Domain Template
  6. The Configuration File in WebLogic Server Domain — config.xml (Xml and More)
  7. Configuring Your Oracle Service Bus Domain
  8. WebLogic Server: Installation to Deployment in 30 Minutes
    • To start the wizard on Windows, type:
      • %WL_HOME%\common\bin\config.cmd
    • To start the new domain, do:
      • %MW_HOME%\user_projects\domains\dev_domain\startWebLogic.cmd
  9. WebLogic Server 12c and WebLogic Server 11g Releases (OTN)
  10. Configuration Wizard Screens (12.1.2)

No comments: