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 3: Configuring WebLogic Server Resources with the Administration Console

This tutorial describes how to configure the WebLogic Server resources required to deploy and run the MedRec application on the MedRec server. These resources include:

The tutorial includes the following sections:

 


Prerequisites

Before starting this tutorial:

 


Procedure

Follow these steps to configure WebLogic Server resources for the MedRec server:

Step 1: Invoke the Administration Console for the MedRec server in your browser.

You use the Administration Console to create the WebLogic Server resources used by the MedRec application suite.

  1. Open the Administration Console by navigating in a browser to:
  2. http://host:7101/console

    where host refers to the computer on which MedRecServer is running. If your browser is on the same computer as MedRecServer, then you can use the URL http://localhost:7101/console.

  3. Specify weblogic for both the username and password and click Log In.

You can also open the Administration Console from the Windows Start menu:

StartArrow symbolAll ProgramsArrow symbolBEA ProductsArrow symbolUser ProjectsArrow symbolMedRecDomainArrow symbolAdmin Server Console

Step 2: Create the stand-alone JDBC data sources.

In WebLogic Server, you configure database connectivity by adding JDBC data sources to your WebLogic domain. A data source is a J2EE standard method of configuring connectivity to a database. A data source can be deployed by itself as a stand-alone module, or deployed as part of an Enterprise application as a packaged module.

Each WebLogic data source contains a pool of database connections. Applications look up the data source in the JNDI tree or in the local application context and then reserve a database connection with the getConnection method. Data sources and their connection pools provide connection management processes that help keep your system running and performing well.

This procedure describes how to create two stand-alone JDBC data sources: the first uses an XA JDBC driver and the second one does not. Typically you always use an XA JDBC driver when creating a data source. However, because JMS JDBC stores do not support XA resource drivers (WebLogic JMS implements its own XA resource), a second non-XA data source is needed. A later procedure shows how to associate the non-XA data source to a JMS JDBC store.

  1. Click Lock & Edit, located in the upper left Change Center window of the Administration Console.
  2. In the left Domain Structure window, expand MedRecDomainArrow symbolServicesArrow symbolJDBC.
  3. Click Data Sources.
  4. In the right pane, click New.
  5. On the JDBC Data Source Properties page:
    • In the Name field, enter MedRecGlobalDataSource.
    • In the JNDI Name text box, enter jdbc/MedRecGlobalDataSource.
    • Select PointBase as the Database Type.
    • Select PointBase's Driver (Type 4) Versions:4.X 5.X as the Database Driver.
  6. Click Next.
  7. On the Transaction Options page, un-check Supports Global Transactions.
  8. This JDBC data source will be used to create a JDBC store, which requires that the data source not support global transactions.

  9. Click Next.
  10. On the Connection Properties page:
    • In the Database Name field, enter demo.
    • In the Host Name field, enter localhost (default value).
    • In the Port field, enter 9092 (default value).
    • In the Database User Name field, enter medrec.
    • In the Password and Confirm Password fields, enter medrec.
  11. Click Next.
  12. In the Test Database Connection page, ensure that the information to test the connection to the PointBase database is correct.
  13. Text field values are based on information you have already provided as well as default PointBase values (such as the Pointbase driver class name of com.pointbase.jdbc.jdbcUniversalDriver).

    Click Test Configuration to test the connection; the message Connection test succeeded appears in the Messages pane if you have configured the data source correctly.

    Note: Be sure you have started PointBase, or the test of its driver configuration will fail. For details, see Tutorial 2: Starting the PointBase Development Database.
  14. Click Next.
  15. Select the MedRecServer target.
  16. Click Finish.
  17. The new data source is listed in the Data Sources table.

  18. In the Summary of JDBC Data Sources page, click New.
  19. On the JDBC Data Source Properties page:
    • In the Name field, enter MedRecGlobalDataSourceXA.
    • In the JNDI Name text box, enter jdbc/MedRecGlobalDataSourceXA.
    • Select PointBase as the Database Type.
    • Select PointBase's Driver (Type 4XA) Versions:4.X 5.X as the Database Driver.
  20. Click Next.
  21. On the Transaction Options page, click Next.
  22. On the Connection Properties page:
    • In the Database Name field, enter demo.
    • In the Host Name field, enter localhost (default value).
    • In the Port field, enter 9092 (default value).
    • In the Database User Name field, enter medrec.
    • In the Password and Confirm Password fields, enter medrec.
  23. Click Next.
  24. In the Test Database Connection page, ensure that the information to test the connection to the PointBase database is correct.
  25. The values of the text fields are based on information you have already provided as well as default Pointbase values (such as the Pointbase XA driver class name of com.pointbase.xa.xaDataSource).

    Click Test Configuration to test the connection; the message Connection test succeeded appears in the Messages pane if you have configured the data source correctly.

    Note: Be sure you have started PointBase, or the test of its driver configuration will fail. For details, see Tutorial 2: Starting the PointBase Development Database.
  26. Click Next.
  27. Select the MedRecServer target.
  28. Click Finish.
  29. The new data source is listed in the Data Sources table.

  30. In the Change Center, click Activate Changes to update the MedRec server configuration.

Step 3: Create the file stores used by Web Services reliable messaging.

The Web Services reliable messaging feature uses a persistent store to store its messages. The MedRec tutorials describe how to use a file store to store the messages; you can also use a JDBC store as described in the next step.

Note: WebLogic Web Services reliable messaging is a service-to-service feature, which means that one client Web Service invokes another Web Service reliably. Typically each Web Service is deployed to two different WebLogic Server instances; each server instance in turn has its own store-and-forward (SAF) agent and persistent store. However, because these tutorials assume a single-server domain for ease of development, both Web Services are deployed to the same server, and thus use the same SAF agent and persistent store.
  1. If you have not already done so, click Lock & Edit, located in the upper left Change Center window of the Administration Console.
  2. In the left Domain Structure window, expand MedRecDomainArrow symbolServices.
  3. Click Persistent Stores.
  4. In the right pane, click New and choose the Create FileStore option.
  5. In the Name field, enter MedRecWseeFileStore.
  6. In the Target drop-down list, select MedRecServer.
  7. In the Directory field, enter medrecWseeFileStore.
  8. Click Finish.
  9. In the Change Center, click Activate Changes to update the MedRec server configuration.

Step 4: Create a JMS JDBC store.

Persistent stores are used to store persistent messages. This JMS JDBC store uses the non-XA data source you created in Step 2: Create the stand-alone JDBC data sources.

  1. If you have not already done so, click Lock & Edit, located in the upper left Change Center window of the Administration Console.
  2. In the left Domain Structure window, expand MedRecDomainArrow symbolServices.
  3. Click Persistent Stores.
  4. In the right pane, click New and choose the Create JDBCStore option.
  5. In the Name field, enter MedRecJMSJDBCStore.
  6. In the Target drop-down list, select MedRecServer.
  7. In the Data Source drop-down list, select MedRecGlobalDataSource.
  8. In the Prefix Name field, enter MedRec.
  9. Click Finish.
  10. In the Change Center, click Activate Changes to update the MedRec server configuration.

Step 5: Create JMS servers.

JMS servers host the queue and topic destinations used by JMS clients. To persistently store messages in destinations, the JMS server must be configured with a JMS store.

  1. If you have not already done so, click Lock & Edit, located in the upper left Change Center window of the Administration Console.
  2. In the left Domain Structure window, expand MedRecDomainArrow symbolServicesArrow symbolMessaging.
  3. Click JMS Servers.
  4. In the right pane, click New.
  5. In the Name field, enter MedRecJMSServer.
  6. In the Persistent Store drop-down list, select MedRecJMSJDBCStore.
  7. Click Next.
  8. In the Target drop-down list, select MedRecServer.
  9. Click Finish.
  10. In the Summary of JMS Servers page, click New.
  11. In the Name field, enter MedRecWseeJMSServer.
  12. In the Persistent Store drop-down list, select MedRecWseeFileStore.
  13. Click Next.
  14. In the Target drop-down list, select MedRecServer.
  15. Click Finish.
  16. In the Change Center, click Activate Changes to update the MedRec server configuration.

Step 6: Create the stand-alone JMS module and queue.

JMS queues are based on the point-to-point (PTP) messaging model, which enables the delivery of a message to exactly one recipient. A queue sender (producer) sends a message to a specific queue. A queue receiver (consumer) receives messages from a specific queue.

You configure JMS queues by first creating a stand-alone JMS module and then configuring it with a JMS queue, as described in the following procedure.

In addition to the queue that is part of the stand-alone JMS module, the medrecEar application uses the following JMS queues configured as part of a packaged JMS module,

These application-scoped JMS queues are first registered in the weblogic-application.xml deployment descriptor of the medrecEar application, and then described in XML files.

  1. If you have not already done so, click Lock & Edit, located in the upper left Change Center window of the Administration Console.
  2. In the left Domain Structure window, expand MedRecDomainArrow symbolServicesArrow symbolMessaging.
  3. Click JMS Modules.
  4. In the right pane, click New.
  5. On the Create JMS System Module page:
    • In the Name field, enter MedRec-jms.
    • In the Descriptor File Name field, enter MedRec-jms.xml.
    • For simplicity, leave the optional Location in Domain field blank.
  6. Click Next.
  7. In the Targets box, check MedRecServer.
  8. Click Next.
  9. Check the Would You Like to Add Resources to This JMS System Module? checkbox.
  10. Click Finish.
  11. At the bottom of the Configuration tab, above or below the Summary of Resources table, click New.
  12. Choose the Queue option.
  13. Click Next.
  14. In the JMS Destination Properties page:
    • In the Name field, enter weblogic.wsee.reliability.wseeMedRecDestinationQueue.
    • In the JNDI Name field, enter weblogic.wsee.DefaultQueue.
    • Leave the Template drop-down list to None.
  15. Click Next.
  16. To the right of the SubDeployments drop-down list, click Create a New Subdeployment.
  17. In the SubDeployment Name field, enter MedRecWseeJMSServer.
  18. Click OK.
  19. In the Targets box, check MedRecWseeJMSServer.
  20. Click Finish.
  21. In the Change Center, click Activate Changes to update the MedRec server configuration.

Step 7: Create the Store and Forward (SAF) agent.

The Store-and-Forward (SAF) service enables WebLogic Server to deliver messages reliably between applications that are distributed across WebLogic Server instances. In the MedRec application, the SAF service is used internally by the Web Services that have been configured with reliable messaging.

Note: WebLogic Web Services reliable messaging is a service-to-service feature, which means that one client Web Service invokes another Web Service reliably. Typically each Web Service is deployed to two different WebLogic Server instances; each server instance in turn has its own SAF agent and persistent store. However, because these tutorials assume a single-server domain for ease of development, both Web Services are deployed to the same server, and thus use the same SAF agent.
  1. If you have not already done so, click Lock & Edit, located in the upper left Change Center window of the Administration Console.
  2. In the left Domain Structure window, expand MedRecDomainArrow symbolServicesArrow symbolMessaging.
  3. Click Store-and-Forward Agents.
  4. In the right pane, click New.
  5. On the Store-and-Forward Agent Properties page:
    • In the Name field, enter MedRecSAFAgent.
    • In the Persistent Store drop-down list, select MedRecWseeFileStore.
    • In the Agent Type drop-down list, select Both.
  6. Click Next.
  7. In the Servers box, check MedRecServer.
  8. Click Finish.
  9. In the Change Center, click Activate Changes to update the MedRec server configuration.

Step 8: Add email capabilities to the MedRec application.

WebLogic Server includes the JavaMail API version 1.3 reference implementation from Sun Microsystems. Using the JavaMail API, you can add email capabilities to your WebLogic Server applications. To configure JavaMail for use in WebLogic Server, you create a mail session in the WebLogic Server Administration Console. A mail session allows server-side components and applications to access JavaMail services with JNDI, using Session properties that you pre-configure.

  1. If you have not already done so, click Lock & Edit, located in the upper left Change Center window of the Administration Console.
  2. In the left Domain Structure window, expand MedRecDomainArrow symbolServices.
  3. Click Mail Sessions.
  4. In the right pane, click New.
  5. In the Name field, enter mail/MedRecMailSession.
  6. Click OK.
  7. In the table of Mail Sessions, click on mail/MedRecMailSession.
  8. Select the Configuration tab and:
    • In the JNDI Name field, enter mail/MedRecMailSession.
    • In the JavaMail Properties text box, enter values for the mail.user and mail.host properties.
    • For example, if you want email generated by the MedRec application to be sent to you, and your email address is joe@mail.mycompany.com, enter:

      mail.user=joe;mail.host=mail.mycompany.com
  9. Click Save.
  10. Select the Targets tab.
  11. In the Servers box, check MedRecServer.
  12. Click Save.
  13. In the Change Center, click Activate Changes to update the MedRec server configuration.

Step 9: Configure the MedRec Custom DBMS Authenticator.

The MedRec Custom DBMS Authenticator retrieves login credentials from the configured PointBase RDBMS for a given username. Within the provider, passwords are validated, and if correct, the user's group associations are retrieved.

  1. If you have not already done so, click Lock & Edit, located in the upper left Change Center window of the Administration Console.
  2. In the left Domain Structure window, click MedRecDomainArrow symbolSecurity Realms.
  3. In the right pane, click the myrealm entry of the Realms table.
  4. Select the ProvidersArrow symbolAuthentication tab.
  5. Click New.
  6. On the Create a New Authentication Provider page:
    • In the Name field, enter MedRecSampleAuthenticator.
    • In the Type drop-down list, select CustomDBMSAuthenticator.
  7. Click OK.
  8. In the Authentication Providers table, click MedRecSampleAuthenticator.
  9. Select the ConfigurationArrow symbolCommon tab.
  10. In the Control Flag drop-down list, select SUFFICIENT.
  11. The SUFFICIENT control flag indicates that the LoginModule does not need to succeed. If it does succeed, control is returned to the application. However, if it does not succeed, the server tries other configured authentication providers.

  12. Click Save.
  13. Select the ConfigurationArrow symbolProvider Specific tab.
  14. In the Data Source Name field, enter MedRecGlobalDataSourceXA.
  15. In the Plug-in Class Name field, enter com.bea.medrec.security.MedRecDBMSPlugin.
  16. This plug-in class is physically located in the MedRecDBMSPlugin.jar file that you added to WebLogic Server's CLASSPATH in Tutorial 1: Creating a WebLogic Domain and Server Instance for Development.

  17. Click Save.
  18. In the left Domain Structure window, click MedRecDomainArrow symbolSecurity Realms.
  19. In the right pane, click the myrealm entry of the Realms table.
  20. Select the ProvidersArrow symbolAuthentication tab.
  21. In the Authentication Providers table, click DefaultAuthenticator.
  22. In the Control Flag drop-down list, select SUFFICIENT.
  23. Click Save.
  24. In the left Domain Structure window, click MedRecDomainArrow symbolSecurity Realms.
  25. In the right pane, click the myrealm entry of the Realms table.
  26. Select the ProvidersArrow symbolAuthentication tab.
  27. Click Reorder.
  28. Because WebLogic Server cycles through available Authentication providers, this step reorders the provider list so that the PointBase database is not queried each time a login is attempted (for example, each time you log into the Administration Console in subsequent tutorials).

  29. Use the arrows in the Authentication Providers list to define the following order of authentication providers:
    1. DefaultAuthenticator
    2. MedRecSamplesAuthenticator
    3. DefaultIdentityAsserter
  30. Click OK.
  31. In the Change Center, click Activate Changes to update the MedRec server configuration.

You must restart the MedRecServer for these changes to take full effect. For details, see the next tutorial, Tutorial 4: Using WebLogic Server Development Mode.

 


Best Practices

 


The Big Picture

The MedRec application uses JMS to create a new patient record. The asynchronous nature of JMS allows the task to be queued and completed later while the user continues with another task.

After the user clicks Create on the Web page to register a new patient, a JMS message is created and put on the REGISTRATION_MDB_QUEUE application-scoped JMS queue. The RegistrationEJB message-driven bean takes the message off the queue and persists the new patient data to the database using an instance of the PatientEJB entity bean. The PatientEJB entity bean uses the JDBC data source to connect to the PointBase database.

The MedRec application uses other entity beans to persist additional data to the database; for details, see Patient, Physician, and Administrator Data.

The MedRec application uses persistent JMS messaging, which means that the new patient JMS messages that are put on the queue are also stored in a PointBase database so that the messages can be retrieved in case a problem occurs (such as a server crash) before the message-driven bean is able to process them. The application uses the JMS JDBC store to connect to and to update the JMS tables in the PointBase database.

The medrecEar application has two flavors of Web Services that the physicianEar application invokes: reliable and non-reliable. The reliable Web Service uses the store-and-forward agent and filestore internally to ensure that the messages are delivered reliably.

The WebLogic Server security framework cycles through the three configured providers (DefaultAuthenticator, MedRecSamplesAuthenticator, and DefaultIdentityAsserter) during patient authentication.

 


Related Reading


  Back to Top       Previous  Next