Sie sind auf Seite 1von 3

[1] Launch the application outside VuGen

This is the basic verification as we want to know if the Java application can work first even
before recording in Vugen. This will help to reduce the troubleshooting effort.

[2] Setup the Java environment

This is to setup all required environment as required in Document ID 11878, “LoadRunner Java
Environmental Requirements” are met before we can proceed to record/replay on the local
machine. Take about 15 minutes to read and go through the document.

[3] Verify the Java environment setup in [2]

Create an empty RMI-Java VUser and replay it. If the replay encounter no error, the setup is
valid. If not, then rework on point [2] to correct the Java environment.

[4] Proceed to record the RMI-Java VUser

If all is setup properly and the supported JDK are installed, Vugen should be able to record. If
not, proceed to [5].

5] If application does not launch during recording

The most likely cause of the problem is that the classes are not loaded which maybe missing
from the CLASSPATH. Without the definition of the classes in the CLASSPATH, the
application may not be able to launch. To resolve this problem, ensure the CLASSPATH is set
properly.

a. Use javap.exe (available in JDK only) on the command line to check the missing method or
class. To use javap.exe, run: javap.exe (without the “.class” suffix). When the class is not in the
CLASSPATH, you will get the following error message: ‘Class not found’. Otherwise you will
receive all its fields and methods. For more information of javap.exe, you can refer to MindProd
and Sun Microsystem.

From here, look at the missing classes. If there are missing classes, obtain a copy from the
developers of the application, and placed them into the CLASSPATH (including the classes
directory you’ve defined for the recording).

b. Use Java-Plugin to identify the error message. Troubleshoot the error accordingly. For the
plugin, it will throw the exception into its console. You will have to turn on the Java Console (in
Control Panel > Java > “Advanced” Tab > Select “Show Console” in order to capture the
exception or information. If exceptions were captured in the console, look at the error message
and troubleshoot from there. As the exceptions may vary, you will have to see what is been
thrown out in order to resolve the problem and we won’t be able to advise on it. (NOTE: The
steps for the Java Console is based on JRE 1.5.0_06, therefore it may vary with other versions
of Java Plugin.)
[6] If application launches but not recording (Green box illustrated below does not launch)

The problem can be caused where the default hooking mechanism is not loaded. To resolve the
problem, follow the below suggestions for hooking mechanism.

a. Try running the -Xrunjdkhook outside VuGen via a .bat file. This is an easy way to verify
the command statement with -Xrunjdkhook is working fine when invoking outside of VuGen. If
it fails, you can proceed to (b), else look at the additional notes section to see if it fulfill any of
the points mentioned.

b. Ensure that the hook files are properly set.

c. If you are doing custom hooking, verify that the hooks are properly configured with reference
to the “Document ID 11287 – How to do Java custom hooking”.

d. Verify -Xrunjdkhook exist in the arguments passed to invoke the Java application. Below is
a sample command line.

SET java -Xrunjdkhook -Xbootclasspath/p:\classes;\classes\srv -jar javaapp.jar

e. Ensure the file user.hooks is placed in \classes.

f. Verify the content of cjhook.ini

g. Look at the errors associated with hooking mechanism; this can be achieved with the
following steps.

Enable in recording options > Recording Properties > Debug Options.


Enable all checkboxes, and set “Hooking Options” > “Printout Redirections” to “File”
instead of “Console”.

After doing so, useful debugging information will be saved during recording in the file
“/data/console.log”, and “/data/console2.log”.

[7] No events or hang recorded after Green Recording box is launched

This maybe a result of class files not correctly configured in the CLASSPATH. To resolve the
problem, rework to step [5] and apply the solutions.

[8] Try on another machine


When all else fails, try it on another machine to verify if it is feasible to record the Java
application. If this still fails, look at the Additional Notes section to verify if your Java
application is compatible for recording.

Additional Notes

These are points to note when you are working with RMI-Java.

1. JDK vs. JRE

It is required that JDK be installed instead of JRE as JRE is not sufficient for successful
recording

2. Is the JDK a supported version?

With the JDK information, it’s best to ensure the JDK is supported by Vugen (although it is
highly dependant on the JDK that you installed). The supported JDK is Sun JDK. Other JDKs
such as IBM JDK is not supported by Vugen and may need to engage consultation services to
work around it or study the feasiblity.

3. Is QTP installed on the machine?

QTP may conflict with LoadRunner Java environment variables as Vugen maybe misled to use
the QTP CLASSPATH. As such, you can either uninstall QTP or use another machine.

4. Record from a new machine

Sometimes, the settings on the problamtic machine maybe different and it will be an easy option
to use a different machine to find out if there are any differentiating parameter between the two.

5. Importance of CLASSPATH and classes

Vugen rely heavily on the CLASSPATH to determine the classes to load for recording.
Therefore, (1) always ensure the CLASSPATH has all the entries of the application before the
recording and (2) the classes from the application existed physically in the classes folder that the
CLASSPATH points to.

The above should sum up the steps to ensure successful recording. However, do take note of the
points in Additional Steps so as to reduce the effort required to work with this protocol.

Das könnte Ihnen auch gefallen