Error: "-22992 Can’t find Actions.class" when running a Java Vuser script
The following errors occur when running a Java Vuser script:
"-22992 Can’t find Actions.class"
"-22997 Java Vuser Compilation failed"
Make sure that there is a file named "Actions.class" within the script directory. This is the Java bytecode file generated from compiling Actions.java. If this file does not exists, there could be a compilation problem. Please refer to LoadRunner Java Environmental Requirements for details on setting up the Java environment on the machine.
If the file exits, verify the folllowing:
1. Ensure the <JDK>\bin and <LoadRunner>\bin directories are in the PATH environment variable.
2. Ensure <LoadRunner>\classes, <LoadRunner>\classes\srv, and <JDK>\jre\lib\rt.jar are in the CLASSPATH environment variable (preferably at the beginning of the entry).
3. Add any necessary application CLASSPATHs to environment variable.
4. Remove potentially conflicting entries in both the PATH and CLASSPATH entries (sometimes having the Java environment set up for WinRunner will conflict with the LoadRunner compilation process).
5. Make sure to restart the Controller or VuGen in order to have changes in steps 1-4 registered.
6. If the script was working and started to throw the above error for no obvious reasons, try to clean up the initialization files and reregister LoadRunner’s DLL. To reregister the DLLs and recreate the configuration files:
a. Make sure all the LoadRunner applications are closed.
b. Go to <LoadRunner>\bin directory and execute register_vugen.bat.
c. Go to C:\Winnt, back up vugen.ini, then delete the file. LoadRunner will recreate new configuration files when VuGen is launched.
7. The JVM is limited to 56 KB per function. If one or more of the functions within the Actions class is too big, you will get the above error. To resolve this, break the function up into multiple functions.
The following function has to many lines of code.
public int Action()
Break it up by changing the code to look like the following.
public int Action()
public int action1()
public int action2()
//Some more code..
The execution will be exactly the same.