Avitek Medical Records Development Tutorials

     Previous  Next    Open TOC in new window    View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

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 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, along with other supporting configuration XML files, 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:

 


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 a single server that will host the MedRec back-end services, the MedRec Administration application, and the Patient application (both applications are Web applications).

  1. Launch the Configuration Wizard:
  2. StartArrow symbolAll ProgramsArrow symbolBEA ProductsArrow symbolToolsArrow symbolConfiguration Wizard

  3. In the Welcome window, select Create a new WebLogic domain.
  4. Click Next.
  5. In the Select Domain Source window, select the option that begins Generate a domain configured automatically ...
  6. For the sake of simplicity, do not check any other BEA Products, such as Workshop for WebLogic Platform, AquaLogic Service Bus, or Apache Beehive.

  7. Click Next.
  8. In the Configure Administrator Username and Password window, enter:
    • weblogic for User Name
    • weblogic for User Password and Confirm user Password
    • An optional description.
    • You use this username and password when you start the server and log in to the Administration Console.

      Note: In a production environment the user name and password should not be the same.
  9. Click Next.
  10. In the Configure Server Start Mode and JDK window, select:
    • Development Mode for WebLogic Domain Startup Mode
    • Sun SDK 1.5.0_XX @ JDK_location, under the BEA Supplied JDKs option, for JDK Selection
    • 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.

  11. Click Next.
  12. In the Customize Environments and Services Settings window, select Yes.
  13. Click Next.
  14. In the Configure the Administration Server window, enter or select:
    • MedRecServer for Name.
    • All Local Addresses for Listen Address.
    • 7101 for Listen Port.
    • This tutorial specifies that you enter a port number that is deliberately different from the default port number of the Examples server (7011), which is also the general default WebLogic Server port number. If you have already configured this number for another WebLogic Server instance, enter a different value to avoid network communication conflicts. The port must be dedicated TCP/IP port for the Administration Server. The port number can be any integer from 1 to 65535.

    • The SSL Enabled check box.
    • 7102 for SSL Listen Port.
    • This tutorial specifies that you enter an SSL port number that is deliberately different from the default SSL port number (7012). If you have already configured this number for the SSL listen port of another WebLogic Server instance, enter a different value to avoid network communication conflicts. The port must be dedicated TCP/IP port and cannot be the same as the Server Listen Port. The port number can be any integer from 1 to 65535.

  15. Click Next.
  16. Select Next in the following windows without making any changes:
    • Configure Managed Servers
    • Configure Machines
  17. In the Review WebLogic Domain window, click on MedRecServer in the left pane and review your choices, then click Next.
  18. In the Create WebLogic Domain window:
    1. Enter MedRecDomain as the Domain Name.
    2. Click Create to create the MedRec domain in the folder displayed in the Domain Location text box. When the Configuration Wizard finishes creating the domain, the Domain Created Successfully! message is displayed.
  19. Click Done to close the Configuration Wizard.
  20. Do not check Start Admin Server.

Step 2: Enable log4j for logging application messages.

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. You also need to copy the log4j jar files to the lib directory of the MedRec domain. To complete these steps:

  1. Copy the log4j properties file from the pre-configured MedRec domain (under the main WebLogic Server installation directory) to the new domain you just created.
  2. For example, if you installed WebLogic Server in the c:\bea directory, then enter the following in a command-line shell:

    prompt> copy c:\bea\weblogic92\samples\domains\medrec\log4jConfig.xml c:\bea\user_projects\domains\MedRecDomain
  3. Open the setDomainEnv.cmd script, located in the bin directory of your newly created domain directory, for your new domain in a text editor. For example:
  4. prompt> notepad c:\bea\user_projects\domains\MedRecDomain\bin\setDomainEnv.cmd
  5. Find the following line in the setDomainEnv.cmd script:
  6. if NOT "%LOG4J_CONFIG_FILE%"=="" (
  7. Add the following two lines immediately before the line specified in the preceding step:
  8. set LOG4J_CONFIG_FILE=c:\bea\user_projects\domains\MedRecDomain\log4jConfig.xml
    for %%i in ("%LOG4J_CONFIG_FILE%") do set LOG4J_CONFIG_FILE=%%~fsi

    It is assumed in the preceding text that the MedRecDomain directory is c:\bea\user_projects\domains\MedRecDomain; enter your exact domain directory if it is different.

  9. Save the file and exit your text editor.
  10. Copy the log4j JAR files from the lib directory of the pre-configured MedRec domain to the lib directory of the new domain you just created:
  11. prompt> copy c:\bea\weblogic92\samples\domains\medrec\lib\*.jar c:\bea\user_projects\domains\MedRecDomain\lib 

    All JAR files in the lib subdirectory of a domain directory are automatically added to the WebLogic Server system CLASSPATH when the servers in the domain start up.

Step 3: Add the MedRecDBMSPlugin.jar to the server's CLASSPATH.

The MedRec application suite uses a custom DBMS authenticator to retrieve login credentials from the configured PointBase RDBMS for a given username. The Java class that implements this authenticator is in the MedRecDBMSPlugin.jar file, located in the already-installed MedRec domain. You must add the JAR file to the MedRecServer's CLASSPATH so that you can successfully configure the custom authenticator using the Administration Console (described in Tutorial 3: Configuring WebLogic Server Resources with the Administration Console).

  1. Open the setDomainEnv.cmd script, located in the bin directory of your domain directory, for your new domain in a text editor. For example:
  2. prompt> notepad c:\bea\user_projects\domains\MedRecDomain\bin\setDomainEnv.cmd
  3. Find the following line in the setDomainEnv.cmd script:
  4. set PRE_CLASSPATH=
  5. Update the PRE_CLASSPATH variable by adding the full path name of the MedRecDBMSPlug.jar file, which is located in the WL_HOME\samples\domains\medrec\security directory, where WL_HOME refers to the root directory of WebLogic Server (default c:\bea\weblogic92). For example:
  6. set PRE_CLASSPATH=c:\bea\weblogic92\samples\domains\medrec\security\MedRecDBMSPlugin.jar
  7. Save the file and exit your text editor.

Step 4: Start the MedRec Administration Server.

Start the MedRec Administration Server using one of the following methods:

From the Start menu:

StartArrow symbolAll ProgramsArrow symbolBEA ProductsArrow symbolUser ProjectsArrow symbolMedRecDomainArrow symbolStart Admin Server for WebLogic Server Domain

From a script:

  1. 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 command prompt, enter:
  2. prompt> cd c:\bea\user_projects\domains\MedRecDomain
  3. Invoke the startWebLogic.cmd script to start the MedRec server:
  4. (Windows) prompt> startWebLogic.cmd

    (UNIX) prompt> ./startWeblogic.sh

During startup, you will see a message similar to the following once the server is ready to be used:

<Jul 24, 2006 2:03:56 PM PDT> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>

 


Best Practices

 


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


  Back to Top       Previous  Next