Installing and Configuring the J2EE Monitor

Installing and Configuring the J2EE Monitor

Requirements

For LoadRunner 7.6 GA and above:

  • The J2EE monitor is included as a part of LoadRunner 7.6 GA installation and above. No additional patches are required.

For Controller 7.6 (upgrade from LoadRunner 7.51 Service Pack 1):

  • Apply LR76P1. You can download it from the Customer Support website under Downloads ® Patches ® LoadRunner ® 7.6 ® Performance Monitors ® LR76P1.

For LoadRunner 7.51:

  • Apply the LiveUpdate 1 to get to SP1 for LoadRunner 7.51.
  • Apply patch LR751SP1P20. You can download it from the Customer Support website under Downloads ® Patches ® LoadRunner ® 7.51SP1 ® Performance Monitors ® LR751SP1P20.

2.      MSXML 3.0 or later on the Controller machine. MSZML3.0 is included in Internet Explorer 6.0. You can install MSXML 3.0 from XML General Downloads.

Supported Environment

Refer to the following for the supported operating systems, application servers, and components for the J2EE monitor.

1.     Supported Operating Systems

  • Windows NT 4.0/2000(Windows XP is not supported.)
  • Solaris 2.7 or higher
  • IBM AIX 4.3.x

2.     Supported Application Servers

  • WebLogic 4.x, 5.x, 6.x, 7.0
  • WebSphere 3.x, 4.x
  • Oracle 9iAS 1.0.2.2
  • Jboss 2.4.x

3.     Supported Components

  • Servlet (Web Server)
  • JSP (Web Server)
  • JNDI (RMI)
  • Enterprise Java Beans
  • JDBC Calls

How to Install the J2EE Monitor on the Server

1.      Create a new directory on the server machine and name it J2EEMonitor.

2.      Extract the jmonitor_<os>.jar file into the J2EEMonitor directory.

  • For LoadRunner 8.0, the .jar file is in under <Loadrunner 8.0 Addin CD>\Additional components\J2EE_monitors
  • For LoadRunner 7.6 and 7.8, the .jar file is under <LoadRunner76 CD>\LR_76Win32\add-ins\J2EE_monitors
  • For LoadRunner 7.51, the .jar file is in the Patch download section of the Customer Support website.

If you are working on a Unix platform, Unix scripts extracted from the .jar file may lose their execute permissions. To fix this, open the J2EEMonitor Home Directory, and change the permissions using the following command line:

chmod +x *.sh.

3.      From command prompt, navigate to <J2EEMonitor>\classes and run the following command:

java –jar <J2EEMonitor>\classes\sipatool.jar

4.      Configure the monitor based on the type of the application server: WebLogic or JBoss, WebSphere, or Oracle9iAS.

 Oracle 9iAS

Edit the env.cmd file (env.sh in Unix platforms) in <J2EEMonitor> as follows:

  • The JAVA_HOME environment variable should point to the location of the Java Virtual machine used to run the application server.
  • The DETECTOR_INS_DIR environment variable should point to the location of the monitor installation.
  • The APP_SERVER_DRIVE environment variable should specify the drive hosting the application server installation (e.g., D:\). Do not modify this variable on Unix Platforms.
  • The APP_SERVER_ROOT environment variable should specify the application server root directory.

If you want to run the monitor in the JVMPI mode, edit the oc4jMonitor.cmd file (oc4jMonitor.sh in Unix platforms) and the -Xrunjdkhook argument to the Java command line that launches the application server.

WebLogic or JBoss

Note: <J2EEMonitor> refers to the absolute path to the J2EE monitor installation directory.

1.      Stop the application server.

2.      Back up the startup file:

a.      For WebLogic 4.x and 5.x, <WebLogic>\startWeblogic.cmd (startWeblogic.sh on Unix platforms)

b.      For WebLogic 6.x, <WebLogic>\config\<domain name>\startWeblogic.cmd (startWeblogic.sh on Unix platforms)

c.       For WebLogic 7.x, <WebLogic >\server\bin\startWls.cmd (startWls.sh on Unix platforms)

d.      For WebLogic8.x, <WebLogic >\samples\domains\<app>\ startappServer.cmd (startappServer.sh on Solaris platforms)

Note: For WebLogic8.x, modify <J2EE Monitor>/dat/modules.properties to use C hooking by setting the following property:

 

japata.hook.class.name=com.mercuryinteractive.japata.cjhook_mon.CJHookItC

e.      For JBoss 2.4.X, <JBoss Home>\run.bat (run.sh on Unix platforms)

3.      Modify the startup file identified from step 2:

  1. Add <J2EEMonitor\>bin to PATH and <J2EEMonitor>\dat to CLASSPATH:

i.        For Windows platforms

PATH=%PATH%;<J2EEMonitor>bin

CLASSPATH=%CLASSPATH%;<J2EEMonitor>\dat

ii.      For Unix platforms (csh)

LD_LIBRARY_PATH=$LD_LIBRARY_PATH: <J2EEMonitor>/bin

CLASSPATH=$CLASSPATH: <J2EEMonitor>/dat

export LD_LIBRARY_PATH

iii.    Note: For IBM AIX platform

Replace LD_LIBRARY_PATH with LIBPATH.

  1. Add -Xbootclasspath/p:<J2EEMonitor>\classes\boot to the VM param.

Example: 

%JAVA_HOME%\bin\java -ms64m -mx64m

-Xbootclasspath/p:<J2EEMonitor>\classes\boot

-Dweblogic.class.path=%WEBLOGIC_CLASSPATH%

-Dweblogic.home=. -Djava.security.manager –Djava.security.policy==.\weblogic.policy weblogic.Server

 

Note: If you are running in JVMPI mode, you also need to add “-Xrunjdkhook” to the command line. For example,

%JAVA_HOME%\bin\java -ms64m -mx64m

-Xrunjdkhook -Xbootclasspath/p:%MERC_MONITOR_HOME%\classes\boot

-Dweblogic.class.path=%WEBLOGIC_CLASSPATH%

-Dweblogic.home=.

-Djava.security.manager

-Djava.security.policy==.\weblogic.policy weblogic.Server

4.      Save the changes and run the startup file.

WebSphere

Note: <J2EEMonitor> refers to the absolute path to the J2EE monitor installation directory.

 1.      Open the WebSphere Advanced Administrative Console. Then,

  1. For WebSphere 3.x: Expand the WebSphere Administrative Domain tree ® <server machine name> ® Default Server. Select the General tab in the Application Server: Default Server window.
  2. For WebSphere 4.x: Expand the WebSphere Administrative Domain tree then expand the Nodes, hostname, and Application Servers subtrees, and select the Default Server (or the Application Server you wish to use with J2EE monitor). Right-click on the Default Server, select “Properties” from the menu, and click on the General tab.
  3. For WebSphere 5.x: Expand the Server ® Application Servers. Select your server, then go to the “Configuration” tab. Select “Process Definition” from Additional Properties

2.      Add the following line to the Command Line Arguments box:

-Xbootclasspath/p:<J2EEMonitor>\classes\boot

 

Note:

  1. If you are running in JVMPI mode, you also need to add -Xrunjdkhook to the Command Line Arguments box, and click <Apply>.

Example:

-Xbootclasspath/p:<J2EEMonitor>\classes\boot –Xrunjdkhook

  1. If you are working with a WebSphere 3.0 Server with JDK1.1.7 IBM, double-click on “Environment,” and type _CLASSLOAD_HOOK into the Variable Name box and jdkhook into the Value box.

3.      Add <J2EEMonitor>\dat to CLASSPATH:

Note:

For WebSphere 3.x-4.x, click on the Environment button.

For WebSphere 5.x, click on the “Java Virtual machine” link below “Additional Properties.”

For Windows platforms:

CLASSPATH=% CLASSPATH%;<J2EEMonitor>\dat

For Unix platforms (csh):

CLASSPATH=$CLASSPATH: <J2EEMonitor>/dat

How to Activate the J2EE Monitor in the Controller

To enable the J2EE monitor, you must first run a Vuser or a real business process against the application server. After running a Vuser, you can select the counters you want the J2EE monitor to measure. You select these counters using the Controller’s J2EE Monitor Configuration dialog box. Refer to the following for the step-by-step guide to activate J2EE monitor:

1.      Start the application server.

2.      Create a scenario in the Controller.

3.      Run a Vuser script that you intend to use in the load test or a real business process against the application server to activate the monitor.

4.      Open the monitor graph tree in Controller and select “J2EE.”

5.       Right-click the graph and choose “Add Measurement(s).” The J2EE dialog box will open.

6.      Click on “Add” in the Monitored Server Machines box, and enter the server name or IP address, and the platform of the machine you want to monitor.

7.      Click <OK>.

8.      Click on “Add” in the Resource Measurements section of the J2EE dialog box. The J2EE Monitor Configuration dialog box will open, displaying the available J2EE counters. You will see that the methods that participated in the script that you run are the available methods to measure.

9.       Select the methods and counters you wish to measure.

10.  Run the load test and monitor the online graphs of the selected methods.

Note: You do not need to run step 3 the next time you run the same script, because the monitor automatically saves the active methods. The list of the active methods is updated periodically. You can change the frequency in which the methods list are updated by changing the monitor.register.auto_save_period property in the <J2EEMonitor>/dat/monitor.properties file.

Tips & Tricks

1.      The J2EE monitor communicates with LoadRunner using default port 2004. If this port has already been taken, you can select another port:

  1. On the application server machine, open <J2EEMonitor>/dat/monitor.properties and change the port number specified in the webserver.monitor.port property.
  2. On the LoadRunner machine, open <LoadRunner>/dat/monitors/xmlmonitorshared.ini and change the port number specified in the  mon_j2ee section under the “DefaultPort” key.

2.      If you are getting application server initialization errors such as: “UnsupportedClassVersionError,” “NoSuchMethodError,” or “NoClassDefFoundError,” there might be a conflict between the JDK version specified using the J2EE Monitor Initializer and the actual JDK version used in application server launch. Make sure that you selected the correct JDK that is currently being used by the application server. If you switched the application server to work with a different JDK, you must rerun the J2EE Monitor Initializer.

3.      If no metrics appears when monitoring the J2EE monitor, and the Web server on the application server is not starting, verify that cjhook.ini had not been overwritten by running mon_detect.sh.  If it has been overwritten, restore the original cjhook.ini file from the installation .jar file.  The cjhook.ini file is the configuration file needed to set up the hooks into the server for monitoring.

4.      If a syntax error occurs on the autoregmon.xml file when trying to connect to the server from the Controller, a patch needs to be applied for this. Please call Mercury Interactive Customer Support and ask for the Double_Touched_attribute_fix patch.

5.       If the counter window in the Controller flashes on the screen and disappears, install MSXML 3.0.

6.      Only one hooking technology can be active at a time. If you want to change to a different hooking mechanism, you need to remove the changes.

  • For Mercury J2EE Monitor Initializer, rename  <J2EEMonitor>/classes/boot/java to <J2EEMonitor>/classes/boot/java.old.
  • For JVMPI, remove -Xrunjdkhook from the application server command line.
  • For Application Server ClassLoader, remove the -D properties you added, and change any file names back to their original names.

Configuring the Monitor Files

The J2EE monitor is installed with a pre-configured hooking mechanism, operation mode, JDBC information retrieval, and EJB Information Retrieval settings. If you want to change any of these settings, you can do so by reconfiguring the monitor file.

1.        Hooking Mechanism

Note: Only one hooking technology can be active at a time. If you want to change to a different hooking mechanism, you need to remove the changes as outlined in Tips and Trick section.

  1. For the J2EE Monitor Initializer hooking with Java hooking (default setting):
  • Run the sipatool.jar file from <J2EEMonitor>/classes to launch the J2EE Monitor Initializer.
  • Open <J2EEMonitor>/dat/modules.properties, and set the japata.hook.class.name property to:

japata.hook.class.name=com.mercuryinteractive.japata.cjhook_mon.CJHookItJava

  1. For the J2EE Monitor Initializer hooking with C hooking:
  • Run the sipatool.jar file from <J2EEMonitor>/classes to launch the Mercury J2EE Monitor Initializer.
  • Open <J2EE Monitor>/dat/modules.properties, and set the following property:

japata.hook.class.name=com.mercuryinteractive.japata.cjhook_mon.CJHookItC

  1. For JVMPI hooking:

You need to add “-Xrunjdkhook” to the application server command line.

Example:

-Xbootclasspath/p:<J2EEMonitor>/classes/boot –Xrunjdkhook

  1. For Application Server ClassLoader hooking:

i.        Add the following to the application server command line:

  • For WebLogic 5.1

Dweblogic.classloader.preprocessor=com.mercuryinteractive.aim.MercuryWL5Preprocessor

  • For WebLogic 6.1

Dweblogic.classloader.preprocessor=com.mercuryinteractive.aim.MercuryWL6Preprocessor

  • For WebSphere:

Dcom.ibm.ejs.sm.server.ServiceInitializer=com.ibm.ejs.sm.server.WilyInitializer -Dcom.ibm.websphere.introscope.implClass=com.mercuryinteractive.aim.MercuryWASPreprocessor

Note: For WebSphere version 3.5X only.

1.      Download the patch file PQ46831.jar that corresponds to your server version from IBM’s FixPaks and Fixes. You can also get this .jar file from the FTP site:

ftp://ftp.software.ibm.com/software/websphere/appserv/support/fixes/pq46831/

2.      After that, add the patch file to the classpath:

setenv CLASSPATH PQ46831.jar:${CLASSPATH}

ii.      Additional changes for C hooking:

  • Back up the following files in the <J2EEMonitor>/dat directory. You will need to recover these files if you need to change to other hooking mechanism later.

i.      auto_detect.hooks

ii.      auto_detect.hooks_acl

iii.      cjhook.ini

iv.      cjhook.ini_acl

  • Remove <J2EEMonitor>/dat/auto_detect.hooks. Then, rename  <J2EEMonitor>/dat/auto_detect.hooks_acl to <J2EEMonitor>/dat/auto_detect.hooks.
  • Remove <J2EEMonitor>/dat/cjhook.ini. Then, rename <J2EEMonitor>/dat/cjhook.ini_acl to <J2EEMonitor>/dat/cjhook.ini.
  • Open <J2EEMonitor>/dat/modules.properties, and set the following property:

japata.hook.class.name=com.mercuryinteractive.japata.cjhook_mon.CJHookItC

iii.    Additional changes for Java hooking:

  • Back up the following files in the <J2EEMonitor>/dat directory. You will need to recover these files if you need to change to other hooking mechanism later.

i.      auto_detect.hooks

ii.      auto_detect.hooks_acl

iii.      cjhook.ini

iv.      cjhook.ini_acl

  • Remove <J2EEMonitor>/dat/auto_detect.hooks. Then, rename <J2EEMonitor>/dat/auto_detect.hooks_acl to <J2EEMonitor>/dat/auto_detect.hooks.
  • Remove <J2EEMonitor>/dat/cjhook.ini. Then, rename <J2EEMonitor>/dat/cjhook.ini_acl to <J2EEMonitor>/dat/cjhook.ini.
  • Open <J2EEMonitor>/dat/modules.properties, and set the following property:

japata.hook.class.name=com.mercuryinteractive.japata.cjhook_mon.CJHookItJava

2.      Operation Modes

a.      For Auto Discovery (default):

i.        Open <J2EEMonitor>/dat/java_monitor.ini.

ii.      In the “EJB_CONFIG” section of the file:

  • Set monitor_auto_detection to monitor_auto_detection=true.
  • Set hook_files to hook_files=auto_detect.

iii.                Open <J2EEMonitor>/dat/monitor.properties and set the following property:

monitor.register.auto_register_methods = true

b.      For Detector Dependent:

i.        Open <J2EEMonitor>/dat/java_monitor.ini.

ii.      In the “EJB_CONFIG” section of the file:

  • Set monitor_auto_detection to monitor_auto_detection=false.
  • Set hook_files to hook_files=ejb_monitor.

iii.    Open <J2EEMonitor>/dat/monitor.properties and set the following property:

monitor.register.auto_register_methods = false

iv.     Back up the <J2EEMonitor>/dat/cjhook.ini file.

v.       Configure env.sh (env.cmd) and run Mon_Detect.sh (Mon_Detect.cmd).

Note: You need to run Mon_Detector every time J2EE application changes on the server.

3.      JDBC Information Retrieval

a.      Open <J2EEMonitor>/dat/monitor.properties.

b.      Set the monitor.jdbc.mode property to 1,2 or 3 as follows:

  • “1” to measure the JDBC method calls (i.e. executeQuery()).
  • “2” to measure the SQL statements divided into categories like:

SELECT, UPDATE, CREATE,… (Default Setting)

  • “3” to measure each SQL statement including all operations, table(s) it acted on, etc.

Note: SQL Statements that exceed 3000 characters in length are not supported.

 

4.      EJB Information Retrieval

By default, the J2EE monitor is not configured to measure container methods such as ejbPassivate() and ejbCreate(). To enable the monitor to measure container methods, you should configure the monitor as follows:

a.      Open <J2EEMonitor>/dat/java_monitor.ini.

b.      In the “EJB_CONFIG” section of the file, set hook_files to hook_files=auto_detect_container.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s