Configuring Domains and Servers
Tutorial 1: Creating a WebLogic Domain and Server Instance for Development
In this tutorial you use the WebLogic Server Configuration Wizard to create a domain and server necessary to deploy and run the MedRec applications.The tutorial also shows you how to start the server.
The Configuration Wizard asks for information about the domain you want to create based on the configuration template you select, and then creates a config.xml file for the domain based on your responses. The Configuration Wizard also creates startup scripts for the server instances in the domain, and other helper files and directories to help you start and use the new domain and its servers. You will work with these scripts and directories in later tutorials.
The tutorial includes the following sections:
Prerequisites
Before starting this tutorial:
Procedure
To create the MedRec domain and the WebLogic Server instance to which you will deploy MedRec, follow these steps. You will use the domain and server in later tutorials.
Step 1: Create the MedRec domain and MedRec server.
The MedRec domain includes one server that will host the MedRec back-end services, the MedRec Administration application, and the Patient application (both applications are Web applications). As you create the domain and server, click Next at the end of each step to continue to the next step in the procedure.
- Launch the Configuration Wizard:
Start—>Programs—>BEA WebLogic Platform 8.1—>Configuration Wizard
- In the Create or Extend a Configuration window, select Create a new WebLogic configuration.
- In the Select a Configuration Template window, select Basic WebLogic Server Domain.
You select the Basic WebLogic Server Domain template instead of the Avitek Medical Records Sample Domain template because this tutorial is designed to show you how to create an application from the very beginning. The Avitek Medical Records Sample Domain template includes configuration settings for the sample domain which would enable you to skip some configuration steps.
- In the Choose Express or Custom Configuration window, select Custom.
- In the Configure the Administration Server window, enter or select:
- In the following windows, select No:
- In the Configure Administrative Username and Password window, enter or select:
You use this username and password when you boot the server and log in to the Administration Console.
Note: In a production environment the user name and password should not be the same.
- In the Configure Windows Options window, select:
- In the Build Start Menu Entries window, accept the defaults.
- In the Configure Server Start Mode and Java SDK window, select:
The Sun SDK is the default choice for Development mode. You can select either the Sun SDK or the JRockit SDK. The Sun SDK offers faster startup times, where as the JRockit SDK offers faster runtime performance on Intel architectures.
- In the Create WebLogic Configuration window:
- Enter MedRecDomain as the Configuration Name.
- Click Create to create the MedRec domain in the folder displayed in Configuration Location. When the Configuration Wizard finishes creating the domain, the WebLogic Configuration Created Successfully message is displayed.
- Click Exit or Done to close the Configuration Wizard.
Step 2: Edit the server startup script.
The MedRec application suite uses log4j for logging application messages. You must copy the log4j properties file from the pre-configured MedRec domain and identify it using a startup option in MedRecServer startup script. For Web Services, you must also identify the .wsdl and the incoming directory for XML files. To complete these steps:
- Copy the log4j properties file from the pre-configured MedRec domain to the new domain you just created. For example, in a command-line shell, enter:
copy c:\bea\weblogic81\samples\domains\medrec\log4j.properties
c:\bea\user_projects\domains\MedRecDomain
- Open the startWebLogic.cmd script for your new domain in a text editor. For example:
notepad
c:\bea\user_projects\domains\MedRecDomain\startWebLogic.cmd
- Find the following line in the startWebLogic.cmd script:
set JAVA_VENDOR=Sun
- Add the following line immediately after the "set JAVA_VENDOR" line:
Set JAVA_OPTIONS=-Dlog4j.config=log4j.properties
-Dcom.bea.medrec.xml.incoming=incoming
-Dphys.app.wsdl.url=http://127.0.0.1:7101/ws_medrec/MedRecWebSe
rvices?WSDL
- Save the file and exit your text editor.
Step 3: Start the MedRec server.
From the Start menu:
Start—>Programs—>BEA—>WebLogic Platform 8.1—>User Projects—>MedRecDomain—>Start Server
From a script:
- In a command-line shell, go to the root directory of the MedRec domain, typically c:\bea\user_projects\domains\MedRecDomain. For example, from the c:\ prompt, enter:
cd bea\user_projects\domains\MedRecDomain
- Invoke the startWebLogic.cmd script to start the MedRec server:
Windows: startWebLogic.cmd
UNIX: startWeblogic.sh
Best Practices
- Use the Configuration Wizard to create and configure domains. The Configuration Wizard creates the necessary configuration file (config.xml), directory structure, and startup scripts for each new domain.
- Create domain directories outside the WebLogic Server program files. It is best not to mix application files with the application server files. By default, the Configuration Wizard creates domain directories in bea_home\user_projects\domains directory, typically c:\bea\user_projects\domains, which is parallel to the directory in which WebLogic Server program files are stored, typically c:\bea\weblogic81.
The Big Picture
This tutorial is the basis for setting up your development environment. Before you can deploy applications to a server, you must first configure the domains and servers to which you want to deploy the applications. In this tutorial, you created the MedRec domain, which includes one server to host the MedRec applications. You use this domain for most tutorials.
Related Reading