4 Deploying the ADF Monitoring Service

This chapter describes the procedure for deploying and configuring the ADF Monitoring Service.

Using the ADF Monitoring Service is optional, the ADF Monitoring Service allows diagnostics information to be collected from tiers not reachable with Network Protocol Analysis (NPA). This information can be consolidated with other ADF information and used to identify causes of End User Experience problems. The resulting information is available in RUEI Reporting, Data Browser and Session Diagnostics.

4.1 Create a RUEI System User

To communicate with RUEI, the ADF Monitoring Service requires a RUEI user with the ADF Monitoring Service permissions. This permission is only available to a RUEI system account. See the Managing Users and Permissions chapter of the User's Guide for information on creating this account and setting the permission.

4.2 Deploy the ADF Monitoring Service Software

To deploy the ADF Monitoring Service into the WebLogic Server environment:

  1. Copy the RueiEUMService.war file from the /root/RUEI/121/extra directory of the RUEI distribution zip file to a location accessible to the WebLogic server.

  2. Log into the WebLogic Server Administration Console and navigate to the Deployments screen, then click Install to deploy the war file. Install as a library and not as an application.

An alternative to step 2 above is to deploy using the command line:

  1. Set the environment variables:

    setenv BEA_HOME=Weblogic_home_dir
    setenv PATH=JDK_dir/bin:$PATH
    setenv DOMAIN_HOME=${BEA_HOME}/user_projects/domains/domain_name
    export WARFILE=$DOMAIN_HOME/servers/AdminServer/upload/RueiEUMService.war
    

    where

    • Weblogic_home_dir is the location where WebLogic was installed

    • JDK_dir is the location where JDK is installed

    • domain_name is the name of the WebLogic domain

  2. Change directory to the location you used in step one and enter the following commands (enter password when prompted):

    . $BEA_HOME/wlserver_10.3/server/bin/setWLSEnv.sh 
    cp RueiEUMService.war $DOMAIN_HOME/servers/AdminServer/upload/  
    java weblogic.Deployer -adminurl adminurl -username username -deploy -source $WARFILE -targets wlservername -stage -library
     
    

    where:

    • adminurl is the URL for the WebLogic Administration console

    • username is the admin username

    • wlservername is the name of the WebLogic Server

4.3 Configure the ADF Application

To configure the ADF application for use with the ADF Monitoring Service you must redeploy it with a custom deployment plan.

4.3.1 Generate a Default Deployment Descriptor

To generate a standard deployment descriptor of an ADF application's EAR, you can use either the web console or the commands below:

  1. Set the environment variables:

    setenv BEA_HOME=Weblogic_home_dir
    setenv PATH=JDK_dir/bin:$PATH
    

    where

    • Weblogic_home_dir is the location where WebLogic was installed

    • JDK_dir is the location where JDK is installed

  2. Enter the following commands:

    . $BEA_HOME/wlserver_10.3/server/bin/setWLSEnv.sh
    setenv PLANFILE=path_of_app/Appname/deploy/stdplan.xml 
    setenv EARFILE=path_of_app/Appname/deploy/application_file 
    java weblogic.PlanGenerator -all -plan $PLANFILE $EARFILE
    

    where:

    • path_of_app is the full directory location to the ADF application

    • Appname is the name of the ADF application

    • application_file is the name of either your application ear or war file

4.3.2 Modify the Deployment Descriptor

Modify the deployment descriptor files as follows:

  1. Replace the <variable-definition> section of the stdplan.xml file with the following:

    <!-- variables for RUEI eum --> 
    <variable> 
        <name>oracle.adf.view.faces.context.ENABLE_ADF_EXECUTION_CONTEXT_
    PROVIDER</name>
        <value>true</value>
    </variable>
    <variable> 
       
    <name>oracle.sysman.apm.ruei.monitoring.RueiEndUserMonitoringService.rueiUrl</name> 
       <value>http(s)://app_host:port/ruei/receive.php</value>
    </variable>
    <variable> 
        <name>LibraryRef_RueiEUMLibrary</name> 
        <value>RueiEUMLibrary</value>
    </variable> 
    <!-- variables for RUEI eum --> 
     
    

    where:

    • app_host is the hostname for the ADF application

    • port is the port for the ADF application

  2. Replace the <module-override> section of the WebLogic.xml file with the following:

    <!-- RUEI library -->
    <variable-assignment> 
        <name>LibraryRef_RueiEUMLibrary</name> 
        
    <xpath>/weblogic-web-app/library-ref/[context-root="null",library-name="RueiEndUserMonitoringService"]/library-name</xpath>
    </variable-assignment> 
    <!-- RUEI library --> 
    
  3. Replace the <module-override> section of the web.xml file with the following:

    <!-- set RUEI eum variables -->
    <variable-assignment> 
        <name>oracle.adf.view.faces.context.ENABLE_ADF_EXECUTION_CONTEXT_PROVIDER</name> 
        <xpath>/web-app/context-param/[param-name="oracle.adf.view.faces.context.ENABLE_ADF_EXECUTION_CONTEXT_PROVIDER"]/param-value</xpath>
    </variable-assignment>
    <variable-assignment> 
        <name>oracle.sysman.apm.ruei.monitoring.RueiEndUserMonitoringService.bufferSize</name> 
        <xpath>/web-app/context-param/[param-name="oracle.sysman.apm.ruei.monitoring.RueiEndUserMonitoringService.bufferSize"]/param-value</xpath>
    </variable-assignment>
    <variable-assignment> 
        <name>oracle.sysman.apm.ruei.monitoring.RueiEndUserMonitoringService.flushTime</name> 
        <xpath>/web-app/context-param/[param-name="oracle.sysman.apm.ruei.monitoring.RueiEndUserMonitoringService.flushTime"]/param-value</xpath>
    </variable-assignment>
    <variable-assignment> 
        <name>oracle.sysman.apm.ruei.monitoring.RueiEndUserMonitoringService.rueiUrl</name> 
        <xpath>/web-app/context-param/[param-name="oracle.sysman.apm.ruei.monitoring.RueiEndUserMonitoringService.rueiUrl"]/param-value</xpath>
    </variable-assignment>
     
    <!-- set RUEI eum variables --> 
    

Note:

If any of the variables above already exist in the ADF application you can use <operation>replace</operation> to replace those variables with new values.

4.3.3 Create a Wallet

In Section 4.1, "Create a RUEI System User", you created the user credentials for the ADF Monitoring Service. To create a wallet to store these credentials:

  1. Set the environment variables:

    setenv BEA_HOME=Weblogic_home_dir
    setenv PATH=JDK_dir/bin:$PATH
    

    where

    • Weblogic_home_dir is the location where WebLogic was installed

    • JDK_dir is the location where JDK is installed

  2. Start the WebLogic Server console:

    . $BEA_HOME/wlserver_10.3/server/bin/setWLSEnv.sh
    $BEA_HOME/oracle_common/common/bin/wlst.sh 
    
  3. Enter the following WebLogic Server console command:

    connect()
    

    When prompted, enter the WebLogic administrator username and password. When prompted for the URL, enter t3://admin_host:admin_port where

    • admin_host is the WebLogic hostname

    • admin_password is the WebLogic port

  4. Enter the following WebLogic Server console commands ( enter password when prompted):

    map = "ruei_adf_monitoring_agent"
    key = "receiver"
    desc = "RUEI Receiver"
    
    createCred(map=map, key=key, user="user", password="password", desc=desc)
    

    where:

  5. To ensure the user was created, enter the following WebLogic Server console:

    listCred(map=map, key=key)
    
  6. If the user is listed, enter the following WebLogic Server console to disconnect:

    disconnect()
    
  7. Exit the WebLogic Console using Ctrl-D.

  8. Edit the user_projects/domains/domain_name/config/fmwconfig/system-jazn-data.xml file so that it includes:

    <grant>
                    <grantee>
                        <codesource>
                            <url>file:${domain.home}/servers/${weblogic.Name}/tmp/_WL_user/RueiEndUserMonitoringService/-</url>
                        </codesource>
                    </grantee>
                    <permissions>
                        <permission>
                            
    <class>oracle.security.jps.service.credstore.CredentialAccessPermission</class>
                            <name>context=SYSTEM,mapName=ruei_adf_monitoring_agent,keyName=receiver</name>
                            <actions>read</actions>
                        </permission>
                    </permissions>
    </grant>
     
    

    where

    • domain_name is the name of the WebLogic domain

4.3.4 Redeploy the ADF Application with the Modified Deployment Descriptor

To redeploy the ADF application, either use the WebLogic Server administration console (Deployments > Update) or use the procedure below.

  1. Set the environment variables:

    setenv BEA_HOME=Weblogic_home_dir
    setenv PATH=JDK_dir/bin:$PATH
    . $BEA_HOME/wlserver_10.3/server/bin/setWLSEnv.sh
    setenv PLANFILE=deployment_path/stdplan.xml
    setenv EARFILE=path_to_YourApplicationFile 
    

    where:

    • Weblogic_home_dir is the location where WebLogic was installed

    • JDK_dir is the location where JDK is installed

    • deployment_path is the location of the ADF deployment

    • path_to_YourApplicationFile is the location of the ADF ear or war file

  2. Enter the following commands (enter password when prompted):

    java weblogic.Deployer -adminurl adminurl -username username -deploy -name app_name -source $EARFILE -targets target_server -stage -plan $PLANFILE
    

    where:

    • adminurl is the URL for the WebLogic Administration console

    • username is the admin username

    • app_name is the application deployment name

    • target_server is the name of the target WebLogic Server

4.4 Troubleshooting the ADF Monitoring Service

Use the following procedure to troubleshoot the ADF Monitoring Service:

  1. Log into your ADF application and interact with it to provoke an HTTP request (The ADF Monitoring Service is only initialized after the first HTTP request).

  2. Use a HTTP tool, such as the HTTPHeaders Firefox extension, to make sure that the POST headers include the string oracle.adf.view.rich.monitoring.UserActivityInfo. For example:

    ...&org.apache.myfaces.trinidad.faces.FORM=f1...&oracle.adf.view.rich.monitoring.UserActivityInfo=%3Cm+xmlns%3D%22http%3A%2F%2Foracle.com...
    

    If the header does not include the text, check the web.xml file and the ADF version used.

  3. Check the server logs for library registration log. For example, search the Oracle_Home/Middleware_11.1.2.3.0/user_projects/domains/domain_name/servers/AdminServer/logs/AdminServer.log file for an entry similar to the following:

    Registered library Extension-Name: RueiEndUserMonitoringService
    

    If the log files do not contain an entry similar to the above, make sure the library (RueiEUMService.war) is deployed correctly as described in Section 4.2, "Deploy the ADF Monitoring Service Software".

  4. Check the server-diagnostics.log file for oracle.sysman.apm.ruei entries. For example, the following log entries in AdminServer-diagnostics.log indicate normal operation:

    .[NOTIFICATION] ... Starting RUEI End User Monitoring Service 
    ...[NOTIFICATION] ... Succesfully retrieved information for user eud from the wallet 
    ...[NOTIFICATION] ... Using Basic Authentication 
    ...[NOTIFICATION] ... Set RUEI receiver URL to http://<your ruei host:port>/ruei/receive.php 
    ...[NOTIFICATION] ... RUEI End User Monitoring Service running 
    ...[TRACE]...[SRC_METHOD: logUserActivity] Received useractivity to ruei ecid= 649d46b0ef2a475a:d6e5334:14077999955:-8000-0000000000000259:_adfStreaming 
    ...[TRACE]...[SRC_METHOD: logUserActivity] Received useractivity with requestobject to ruei ecid=weblogic.servlet.internal.RequestEventsFilter$EventsRequestWrapper 
    ...[TRACE]...[SRC_METHOD: process] 9 items for http://<your ruei host:port>/ruei/receive.php
    ......
    

    If you do not find appropriate log entries, repeat the procedures described in this chapter.