Re: Can I write Java code in LoadRunner with Java over HTTP protocol? (2421 Views)
Reply
Occasional Advisor
jackjjou
Posts: 11
Registered: ‎07-24-2013
Message 1 of 10 (3,442 Views)

Can I write Java code in LoadRunner with Java over HTTP protocol?

Hi,

 

I am experiencing issues for writing java code into generated Actions.java, while the project is using Java over HTTP protocol. As soon as I added the code and try to replay again, I got the following stack:

Error:  at java.lang.ClassLoader.defineClass1(Native Method)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
 at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
 at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
 at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
 at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
 at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
 at DummyClassLoader.loadClass(DummyClassLoader.java:15)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
 at ScriptFactory.getScriptObject(ScriptFactory.java:51)
Error: Can't create script object.
Error: Exception was raised when calling abort-cleanup function in extension java_int.dll: System Exceptions: EXCEPTION_ACCESS_VIOLATION
Warning: Extension trans.dll reports error -1 on call to function ExtAbortCleanup
Notify: Found jdk version: 1.7.0.
Notify: classpath=C:\Users\jjou\Documents\VuGen\Scripts\CreateShifts2\;c:\program files (x86)\hp\loadrunner\classes\srv;c:\program files (x86)\hp\loadrunner\classes;C:\Program Files (x86)\HP\LoadRunner\classes;C:\Users\jjou\Documents\VuGen\Scripts\CreateShifts\Reference\commonapp_transfer_applet.jar;C:\Users\jjou\Documents\VuGen\Scripts\CreateShifts\Reference\commonapp_transfer_business.jar;C:\Users\jjou\Documents\VuGen\Scripts\CreateShifts\Reference\commonapp_transfer_shared.jar;C:\Users\jjou\Documents\VuGen\Scripts\CreateShifts\Reference\scheduling_request_applet.jar;C:\Users\jjou\Documents\VuGen\Scripts\CreateShifts\Reference\scheduling_request_shared.jar;C:\Users\jjou\Documents\VuGen\Scripts\CreateShifts\Reference\scheduling_scheduleplanner_applet.jar;C:\Users\jjou\Documents\VuGen\Scripts\CreateShifts\Reference\scheduling_scheduleplanner_shared.jar;C:\Users\jjou\Documents\VuGen\Scripts\CreateShifts\Reference\scheduling_scheduletemplate_applet.jar;C:\Users\jjou\Documents\VuGen\Scripts\CreateShifts\Reference\scheduling_selfscheduling_applet.jar;C:\Users\jjou\Documents\VuGen\Scripts\CreateShifts\Reference\scheduling_setup_applet.jar;C:\Users\jjou\Documents\VuGen\Scripts\CreateShifts\Reference\wfp_timekeeping_timesheet_shared.jar;C:\Users\jjou\Documents\VuGen\Scripts\CreateShifts\Reference\com.kronos.wfc.exceptions_1.0.0.jar;C:\Users\jjou\Documents\VuGen\Scripts\CreateShifts\Reference\platform_resources_shared.jar;C:\Users\jjou\Documents\VuGen\Scripts\CreateShifts\Reference\platform_security_shared.jar;C:\Users\jjou\Documents\VuGen\Scripts\CreateShifts\Reference\platform_utility_framework.jar;;C:\Program Files (x86)\Java\jdk1.7.0_02\jre\lib;C:\Users\jjou\Downloads\eclipse\plugins;;;c:\program files (x86)\hp\loadrunner\lib\xstream-1.3.jar;c:\program files (x86)\hp\loadrunner\lib\xpp3-1.1.4c.jar
Notify: Path=C:\Program Files (x86)\Java\jdk1.7.0_02\jre\bin\client;C:\Program Files (x86)\Java\jdk1.7.0_02\bin;C:\Program Files (x86)\HP\LoadRunner\Bin;C:\Program Files (x86)\HP\LoadRunner\Bin\tulip\bin;D:\app\jjou\product\11.2.0\client_1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft Application Virtualization Client;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Java\jdk1.7.0_02\jre\bin\;C:\Program Files (x86)\HP\LoadRunner\strawberry-perl\perl\bin
Notify: VM Params: .
Error:  at java.lang.ClassLoader.defineClass1(Native Method)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
 at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
 at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
 at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
 at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
 at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
 at DummyClassLoader.loadClass(DummyClassLoader.java:15)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
 at ScriptFactory.getScriptObject(ScriptFactory.java:51)

Error: Can't create script object.
Error: Exception was raised when calling abort-cleanup function in extension java_int.dll: System Exceptions: EXCEPTION_ACCESS_VIOLATION
Warning: Extension trans.dll reports error -1 on call to function ExtAbortCleanup

 

After searching thru the web sites and found most same issues are due to classpath and path setup. But I have double checked those 2 settings and they seemed to be fine (only one jdk specified).

 

The java code I added is creating ArralyList of objects and do some looping to collect runtime data.

 

Can you help please? I am stuck....

 

HP Expert
SergeyKutsos
Posts: 102
Registered: ‎03-28-2011
Message 2 of 10 (3,419 Views)

Re: Can I write Java code in LoadRunner with Java over HTTP protocol?

Hi,

 

What LR version do you work with?

Try with JDK, JRE isn't supported for Java protocols family.

JDK 1.7 is supported starting from LR 11.52.

 

Regards,

Sergey

-----
Sergey Kutsos | LoadRunner QA
LoadRunner - Your performance, Our passion!
Occasional Advisor
jackjjou
Posts: 11
Registered: ‎07-24-2013
Message 3 of 10 (3,411 Views)

Re: Can I write Java code in LoadRunner with Java over HTTP protocol?

Hi,

 

I am using LR 11.52 with JDK 1.7. 

I am using trial version to evaluate its features for Java applets embeded web applications used by our company.  

 

Here is the portion of java code which is httting the issue:

  public static void global_init() throws FileNotFoundException {
    if (ready == false)
      synchronized (lock) {
        if (ready == false) {
        ArrayList<Shifts> shifts = new ArrayList<Shifts>(); // This is the place exception thrown access violation...
        shifts = readCSV("requestBody11.csv",shifts);
        replaceVariables(shifts,"requestBody11.xml");
        RequestObjectListBeanBA0=XmlBasedBinMemoObjectParsing.xml2bin("requestBody8.xml");
        RequestObjectListBeanBA1=XmlBasedBinMemoObjectParsing.xml2bin("requestBody9.xml");
        RequestObjectListBeanBA2=XmlBasedBinMemoObjectParsing.xml2bin("requestBody10.xml");
        ShiftEditorBeanBA3=XmlBasedBinMemoObjectParsing.xml2bin("requestBody11.xml");
        KBeanBA4=XmlBasedBinMemoObjectParsing.xml2bin("requestBody12.xml");
    ready = true;
        }
      }
  }

Frequent Advisor
ArJ3N
Posts: 62
Registered: ‎05-09-2013
Message 4 of 10 (3,392 Views)

Re: Can I write Java code in LoadRunner with Java over HTTP protocol?

Not sure this will help.

Do you want to try using fully qualified names ?

new java.lang.ArrayList instead of short names?

 

Regards,

AJ

HP Expert
KMadan
Posts: 1,090
Registered: ‎05-27-2009
Message 5 of 10 (3,374 Views)

Re: Can I write Java code in LoadRunner with Java over HTTP protocol?

Can you try to compile script outside VuGen?

Madan
Occasional Advisor
jackjjou
Posts: 11
Registered: ‎07-24-2013
Message 6 of 10 (3,365 Views)

Re: Can I write Java code in LoadRunner with Java over HTTP protocol?

Yes, I can. And I have figured out the issue. The problem is that I create a new .java file with a new class and somehow LR solution project created 2 same file to root and data folder and that caused the access violation... I suspect this would be the issue caused by Eclipse which I use to edit the sources.

 

Removing the file from data folder fixes the problem.

 

BTW, I also experience another issue that whenever I update the my .java file in Eclipse that LR and EClipse won't automatically compile to .class. So when I replay the script LR will not execute properly. I have to manually compile it using javac.exe. Any idea to avoid this manual process? Thanks

 

 

HP Expert
KMadan
Posts: 1,090
Registered: ‎05-27-2009
Message 7 of 10 (3,320 Views)

Re: Can I write Java code in LoadRunner with Java over HTTP protocol?

Please declare "ArrayList<Shifts> shifts;" outside of the vuser_init, action & end sections and it solves the problem.


Madan
Frequent Advisor
Gyanendra
Posts: 71
Registered: ‎03-31-2009
Message 8 of 10 (2,424 Views)

Re: Can I write Java code in LoadRunner with Java over HTTP protocol?

Hi ,

 

I am using  Loadrunner 11.52 but it is  not supporting JDK 1.7. showing  JAVA error.  when recording desktop client server application using JAVA record replay protocol .

 

Please let  me know  if I am doing something wrong .

 

Thanks

Gyanendra

 

HP Expert
KMadan
Posts: 1,090
Registered: ‎05-27-2009
Message 9 of 10 (2,421 Views)

Re: Can I write Java code in LoadRunner with Java over HTTP protocol?

Can you post the error you received?


Madan
Occasional Visitor
Suraj_Shankla
Posts: 1
Registered: ‎04-25-2014
Message 10 of 10 (1,853 Views)

Re: Can I write Java code in LoadRunner with Java over HTTP protocol?

32 bit or 64 bit or both would work?

 

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.