Configuring WebSphere Application Server manually

To configure WebSphere® Application Server manually, you must configure variables, custom properties, and class loader policies.

Before you begin

See Planning deployment of administration components and runtimes for the supported deployment topologies.

If you use Cloudant® via https as a database, and WebSphere Application Server full profile as an application server, declare the Cloudant signer certificate, as described in Configuring WebSphere Application Server for use with Cloudant.

Find the SOAP port of the deployment manager (WebSphere Application Server Network Deployment only)
These instructions assume that a stand-alone profile exists with an application server named "Worklight" and that the server is using the default ports.
For WebSphere Application Server Network Deployment, find the SOAP port of the deployment manager:
  1. Open the System Administration/Deployment manager.
  2. In Additional properties, open Ports.
  3. Note the value of SOAP_CONNECTOR_ADDRESS. This value is needed to set the value of the ibm.worklight.admin.jmx.dmgr.port environment entry for the MobileFirst Administration Services.
Review the environment IDs
Specifying an environment ID is optional. However, if you specify an ID, use the same value for each MobileFirst runtime environment that is managed by the same MobileFirst Server administration component. Moreover, this value must match the environment ID that is used when the MobileFirst Server administration component is installed. For more information about the ibm.worklight.admin.environmentid JNDI property, see JNDI environment entries for MobileFirst projects in production.
Note: If you use WebSphere Application Server V7.0, you must add the configuration property "com.ibm.ws.webcontainer.invokerequestlistenerforfilter = true". For more information about how to add this property, see Configuring WebSphere Application Server V7.0.

Procedure

  1. Determine a suitable file name for the MobileFirst shared library in the WebSphere Application Server installation directory.
    • For a standalone server, you can use a file name such as WAS_INSTALL_DIR/optionalLibraries/IBM/project-name/worklight-jee-library.jar.
    • For deployment to a WebSphere Application Server Network Deployment cell, use WAS_INSTALL_DIR/profiles/profile-name/config/cells/cell-name/project-name/worklight-jee-library.jar.
    • For deployment to a WebSphere Application Server Network Deployment cluster, use WAS_INSTALL_DIR/profiles/profile-name/config/cells/cell-name/clusters/cluster-name/project-name/worklight-jee-library.jar.
    • For deployment to a WebSphere Application Server Network Deployment node, use WAS_INSTALL_DIR/profiles/profile-name/config/cells/cell-name/nodes/node-name/project-name/worklight-jee-library.jar.
    • For deployment to a WebSphere Application Server Network Deployment server, use WAS_INSTALL_DIR/profiles/profile-name/config/cells/cell-name/nodes/node-name/servers/server-name/project-name/worklight-jee-library.jar.

    If the directory does not exist, you must create it.

  2. Copy the file product_install_dir/WorklightServer/worklight-jee-library.jar to the location that you determined in step 1.
  3. Log on to theWebSphere Application Server administration console for your MobileFirst Server.

    The address is of the form http://server.com:9060/ibm/console, where server is the name of the server.

  4. Create the MobileFirst shared library definition:
    1. Click Environment > Shared libraries.
    2. From the Scope list, select Worklight server.
    3. Click New. The Configuration pane is displayed.
    4. In the Name field, type WL_PLATFORM_LIB.
    5. Optional: In the Description field, type a description of the library.
    6. In the Classpath field, enter the file name that you determined in step 1, replacing WAS_INSTALL_DIR/profiles/profile-name with the WebSphere Application Server variable reference ${USER_INSTALL_ROOT}.
    7. In Class Loading, select the check box Use an isolated class loader for this shared library.
  5. Create the MobileFirst JDBC data source and provider.
    Note: You do not need to perform this step if you use Cloudant as a database.

    See the instructions for the appropriate DBMS in Creating and configuring the databases manually.

  6. Add a specific web container custom property.
    1. Click Servers > Server Types > Application Servers, and select the server for IBM MobileFirst Platform Foundation.
    2. Click Web Container Settings > Web container.
    3. Click Custom properties.
    4. Click New.
    5. Enter the property values listed in the following table.
      Table 1. Values for the web container custom property
      Property Value
      Name com.ibm.ws.webcontainer.invokeFlushAfterService
      Value false
      Description See http://www.ibm.com/support/docview.wss?uid=swg1PM50111
    6. Click OK.
    7. Click Save.
  7. Install a MobileFirst project WAR file.
    Note: In the following procedure, when the example uses worklight.war, use the name of your MobileFirst project, for example, myProject.war.
    1. Depending on your version of WebSphere Application Server, click one of the following options:
      • Applications > New > New Enterprise Application
      • Applications > New Application > New Enterprise Application
    2. Navigate to the MobileFirst Server installation directory product_install_dir/WorklightServer.
    3. Select worklight.war, and then click Next.
    4. On the "How do you want to install the application?" page, select Detailed, and then click Next.
    5. On the Application Security Warnings page, click Continue.
    6. Click Continue repeatedly until you reach Step 4 of the wizard: Map Shared Libraries.
    7. Select Select for worklight_war and click Reference shared libraries.
    8. From the Available list, select WL_PLATFORM_LIB and click >.
    9. Click OK.
    10. Click Next until you reach the "Map resource references to resources" page.
    11. If you use a relational database, enter the JNDI name you created in step 5 for the jdbc/WorklightDS data source.
    12. You must also enter a default data source in the following cases:
      • You do not use the reports database, whose resource reference is jdbc/WorklightReportsDS. The reports database is not used by default. For more information, see (deprecated) Reports database.
      • You do not need any relational database because you use Cloudant. The data source is not used in this case.

      To enter a default data source, enter DefaultDatasource in the Target Resource JNDI Name field. If the DefaultDatasource does not exist in your application server, a message displays Application Resource Warning when you quit the page. Ignore the warning and click Continue.

    13. Click Next until you reach the "Map context roots for web modules" page.
    14. In the Context Root field, type /worklight.
    15. Click Next.
    16. In Map environment Entries for Web Module, you can assign the JNDI variables according to your configuration.
      • Set the variable ibm.worklight.topology.platform to WAS
      • Set the variable ibm.worklight.admin.jmx.connector to SOAP
      • If the environment ID is set for the Administration Services, set the variable ibm.worklight.admin.environmentid to the same value.
      • On a stand-alone WebSphere Application Server, set the value of ibm.worklight.topology.clustermode to Standalone
      • On WebSphere Application Server Network Deployment, set the variables as follows:
        • ibm.worklight.topology.clustermode: Cluster
        • ibm.worklight.admin.jmx.dmgr.host: the host name of the deployment manager
        • ibm.worklight.admin.jmx.dmgr.port: the SOAP port of the deployment manager
      • If you want to use Cloudant as the database for the MobileFirst runtime, set the variables as follows:
        • mfp.db.cloudant.url: the URL to connect to Cloudant
        • mfp.db.cloudant.username: the Cloudant account user name
        • mfp.db.cloudant.password: the Cloudant account password
        Notes:
        • If this user is not allowed to create a database, you must create a database manually with the names that are documented in Creating the Cloudant database.
        • Each project that uses Cloudant as a database must have its own database. By default, the database includes the project name. But if several teams use the same Cloudant database with projects that have same names, add the JNDI property mfp.db.cloudant.dbNamePrefix to distinguish the projects.
        Important: The Cloudant database name must start with a lowercase letter, and can contain only lowercase characters (a-z), digits (0-9), and any of the following characters: _, $, -.

        The value that you specify for the variable mfp.db.cloudant.dbNamePrefix must comply with this rule.

      • If you installed MobileFirst Operational Analytics, and you want it to collect data from the MobileFirst runtime, set the variables as follows:
        • wl.analytics.url is the URL to connect to a server where MobileFirst Operational Analytics Services is installed.
        • wl.analytics.console.url is the URL to connect to a server where MobileFirst Operational Analytics Console is installed.
        • wl.analytics.username is the user name used for a basic authentication to access the URL that you entered in wl.analytics.url.
        • wl.analytics.password is the password for the user that you entered in wl.analytics.username.
      Note: The user name and password that you provide in wl.analytics.username and wl.analytics.password must match the credentials of the user that you defined in the server where MobileFirst Operational Analytics is installed.
    17. Click Finish.
  8. Optional: As an alternative to step 6, you can map the shared libraries as follows:
    1. Click Applications > Application Types > WebSphere enterprise applications > worklight_war.
    2. In the References section, click Shared library references.
    3. Select Select for worklight_war and click Reference shared libraries.
    4. From the Available list, select WL_PLATFORM_LIB and click >.
    5. Click OK twice to return to the worklight_war configuration page.
    6. Click the Save link.
  9. Define the startup behavior.
    1. Click Applications > Application Types > WebSphere enterprise applications > worklight_war.
    2. Click Startup behavior.
    3. In Startup Order, enter 2.
      Note: The MobileFirst Administration service must already be available when the MobileFirst runtime starts.
  10. Configure the class loader policies and then start the application:
    1. Click the Manage Applications link, or click Applications > WebSphere Enterprise Applications.
    2. From the list of applications, click worklight_war.
    3. In the Detail Properties section, click the Class loading and update detection link.
    4. In the Class loader order pane, click Classes loaded with local class loader first (parent last).
    5. Click OK.
    6. In the Modules section, click Manage Modules.
    7. From the list of modules, click the MobileFirst module.
    8. In the Class loader order pane, click Classes loaded with local class loader first (parent last).
    9. Click OK twice.
    10. Click Save.
    11. Select Select for worklight_war and click Start.
  11. Review the server class loader policy: Click Servers > Server Types > Application Servers > Worklight
    • If the class loader policy is set to Multiple, do nothing.
    • If the class loader policy is set to Single and the class loading mode is set to parent-last, do nothing.
    • If the class loader policy is set to Single and the class loading mode is set to parent-first, change the class loader policy to Multiple, and set the class loader order of all applications other than MobileFirst applications to parent-first.
  12. For WebSphere Application Server Network Deployment, click System administration > Nodes, select the nodes, and click Full Synchronize.

Results

You can now view the runtime component from the MobileFirst Administration Console that is installed in Installing the MobileFirst Server administration. The default URL of the MobileFirst Administration Console is http://<server>:<port>/worklightconsole, where server is the host name of your server and port is the port number (default value 9080).