Hitachi

uCosminexus Application Server System Setup and Operation Guide


2.4.2 Allocating multiple resource adapters for supporting multi-tenants

This subsection describes the procedure for changing a single Web front system to a system supporting multi-tenants by the sharing of the databases. For system configuration, see 1.2.4 Supporting multi-tenancy by allocating multiple resource adapters.

Reference note

For details on the reference locations of the windows, commands, and files used in the description, and the storage locations of the commands and files, see 5. Windows, Commands, and Files used in the System Setup and Operations.

Create a host for allocating multiple resource adapters by adding resource adapters using the management portal. In addition, associate the host with business applications that use the resource adapters. The following table describes the settings used in the example.

Table 2‒9: Settings used in the example (Web front system that supports multi-tenants by allocating multiple resource adapters)

Item

Example of setting

Name of the resource adapter to be added

DB_Connector_for_HiRDB_Type4_2

RAR file to be imported

DBConnector_HiRDB_Type4_CP.rar

Organization of this subsection

(1) Startup and login of Management Portal

If you have already logged in the management portal, proceed to (2) Adding resource adapters.

  1. Start the Web browser, connect to http://localhost:28080/mngsvr/index.jsp, and start the management portal.

  2. Enter "admin" in the management user ID in the Login Management Server window, and click the Login button.

(2) Adding resource adapters

  1. Click Application management of the Logical server on the Management Portal window.

  2. Click DefaultDomain - Logical J2EE Server - J2EE Server - MyJ2EEServer - Resources - Resource Adapter, and then click the Import tab.

  3. Set the information of the resource adapter to be imported to MyJ2EEServer in the Import Resource Adapter window, and click the Execute button.

    As the information of the resource adapter to be imported, select the DB connector, and then select the RAR file (DBConnector_HiRDB_Type4_CP.rar) to be imported from the pull-down menu. Next, select the resource adapter name, and specify the name of resource adapter (DB_Connector_for_HiRDB_Type4_2) to be added.

  4. Click the Back anchor if "Success" is displayed in the Execution result.

    If "Failure" is displayed in the Execution result, click the Display log tab, check the message in the Display Log window, remove the cause of failure, and then import the resource adapter again.

  5. Click DefaultDomain - Logical J2EE Server - J2EE Server - MyJ2EEServer - Resources - Resource Adapter, and then click the Property Settings tab.

  6. Click the Basic Settings anchor of Operation for the resource adapter imported in step 3, in the Resource Adapter Property Settings window.

  7. Set the basic information and properties in the Basic Settings of Resource Adapter window, and click the Settings button.

  8. Check the message displayed in the Basic Settings of the Resource Adapter window, and click the Back anchor.

    If a failure message is displayed, remove the cause of failure, and then set the property again.

(3) Starting the resource adapter

  1. Click Application Management of the Logical Server on the Management Portal window.

  2. Click DefaultDomain - Logical J2EE server - J2EE server - MyJ2EEServer - Resources - Resource adapter, and then click the Start/Stop tab.

  3. Click the Start anchor of Operation on the Start/Stop Resource Adapter window.

  4. Click the Yes button on the Start Resource Adapter window.

  5. Click the Back anchor if "Success" is displayed in the Execution result.

    If "Failure" is displayed in the Execution result, click the Display log tab, check the message in the Display Log window, remove the cause of failure, and then start the resource adapter again.

(4) Settings for associating with business applications

(a) When using lookup in java:comp/env

If you specify java:comp/env/<res-ref-name>-tag-specification-value in the argument of the lookup method in the J2EE application, and then execute, use the management portal to replace the J2EE application with the edited properties, and then start

  1. Edit the cosminexus.xml, and store in the META-INF directory under Any-directory.

    Check the information necessary for name resolution of resource reference with the application developer, and specify the following in the ejb-jar tag, war tag, entity tag, or message tag in the cosminexus.xml.

    For specifying in EJB-JAR property (in ejb-jar tag)

    • Specify resource reference (res-ref-name tag) in the session-resource-ref tag.

    • Specify the display name of the associated DB Connector in the session-resource-ref-linked-to tag.

    For specifying in WAR property (in war tag)

    • Specify resource reference (res-ref-name tag) in the resource-ref tag.

    • Specify display name of the associated DB Connector in the resource-ref-linked-to tag.

    For specifying in the property (in entity tag) of Entity Bean property

    • Specify resource reference (res-ref-name tag) in the resource-ref tag.

    • Specify display name of the associated DB Connector in the resource-ref-linked-to tag.

    For specifying in the property (in message tag) of Message-driven Bean property

    • Specify resource reference (res-ref-name tag) in the resource-ref tag.

    • Specify display name of the associated DB Connector in the resource-ref-linked-to tag.

  2. Execute the jar command with the command prompt, and set the cosminexus.xml edited in step 1, in the J2EE application of archive format.

    Command execution example is as follows:

    jar uvf file path of MyApp1.ear -C directory where META-INF directory is placed> <file path of cosminexus.xml under META-INF directory>

    Specify the path of the J2EE application (MyApp1.ear) storage directory, and the file name (MyApp1.ear) in MyApp1.ear-file-path. directory-where-META-INF-directory-is-placed is Any-directory, if the structure of the store destination of the cosminexus.xml is as follows:

    <Any directory>
     - META-INF
     - cosminexus.xml

    Specify the path of META-INF directory where the cosminexus.xml is stored in step 1, and the file name (cosminexus.xml) in cosminexus.xml-file-path-under-META-INF-directory.

  3. Click Application management of the Logical server on the Management Portal window.

  4. Click DefaultDomain - Logical J2EE server - J2EE server - MyJ2EEServer - Application, and then click the Start/Stop J2EE application tab.

  5. Click the Stop anchor of Operation for the display name (MyApp) of application in the Import J2EE applications list on the Start/Stop J2EE Application window.

  6. Click the Yes button on the Stop J2EE Application window.

  7. Check the Execution result, and click the Back anchor.

    If "Failure" is displayed in the Execution result, click the Display log tab, check the message in the Display Log window, remove the cause of failure, and then stop again.

    If "Success" is displayed in the Execution result, the Status on Start/Stop J2EE Application window changes to "Stopped".

  8. Click DefaultDomain - Logical J2EE server - J2EE server - MyJ2EEServer - Application, and then click the Delete tab.

  9. Click the Delete anchor of Operation for the display name (MyApp) of application in the Import J2EE applications list on the Delete J2EE Application window.

  10. Click the Yes button on the Delete J2EE Application window.

  11. Check the Execution result, and click the Back anchor.

    If "Failure" is displayed in the Execution result, click the Display log tab, check the message in the Display Log window, remove the cause of failure, and then delete the J2EE application again.

    If "Success" is displayed in the Execution result, the application is deleted from the Import J2EE applications list in the Delete J2EE Application window.

  12. Click DefaultDomain.

  13. Enter the J2EE application (MyApp1.ear) recreated in step 2, in the J2EE application files in the Upload J2EE Application window, and then click the Upload button.

  14. Check the displayed message, and click the Back anchor.

    If a failure message is displayed, remove the cause of failure, and then upload again.

    The J2EE application uploaded in step 13 is displayed in the Upload directory files list.

  15. Click DefaultDomain - Logical J2EE server - J2EE server - MyJ2EEServer - Application, and then click the Import tab.

  16. Select the file uploaded in step 13 from the J2EE application files in the Import J2EE Application window, and click the Execute button.

  17. Click the Back anchor, if "Success" is displayed in the Execution result.

    If "Failure" is displayed in the Execution result, click the Display log tab, check the message in the Display Log window, remove the cause of failure, and then import the J2EE application again.

  18. Click DefaultDomain - Logical J2EE server - J2EE server - MyJ2EEServer - Application, and then click the Start/Stop tab.

  19. Click the Start anchor of Operations for the application imported in step 16, existing in the Imported J2EE Applications List on the Start/Stop J2EE Application window.

  20. Click the Yes button on the Start J2EE Application window.

  21. Check the Execution Results, and click the Back anchor.

    If "Failure" is displayed in the Execution result, click the Display log tab, check the message in the Display Log window, remove the cause of failure, and then start the J2EE application again.

    If "Success" is displayed in the Execution result, the Status of the Start/Stop J2EE Application window changes to Operating.

(b) Using the lookup in names assigned by using the User-specified name space functionality

If you specify any name in the argument of the lookup method in the J2EE application while implementing, use the management portal, and set an optional name for the resource in the Connector Property file of the resource adapter. This subsection describes the example of specifying jdbc/DataSource as any name.

  1. Click Application management of the Logical server on the Management Portal window.

  2. Click DefaultDomain - Logical J2EE server - J2EE server - MyJ2EEServer - Resources - Resource adapter, and then click the Property Settings tab.

  3. Click the Edit Connector Property file anchor of Operation for the resource adapter imported in (2) Adding resource adapters in the Resource Adapter Property Settings window.

  4. Set the optional name of the resource in resource-external-property-optional-name tag in the Edit connector property file of Resource Adapter window, and click the Settings button.

    Example of settings is as follows. The optional name of the resource is jdbc/DataSource.

    <connector-runtime>
      <property>
      :
      </property>
      <resource-external-property>
        <optional-name>jdbc/DataSource</optional-name>
      </resource-external-property>
    </connector-runtime>
  5. Check the message displayed in the Basic Settings of Resource Adapter window, and click the Back anchor.

    If a failure message is displayed, remove the cause of failure, and then set the property again.