Highlighted
Absent Member.
Absent Member.
2781 views

Error: Exception in java code, Check your java code and call stack

Help required please...

LR 9.52 using Flex and HTTP/HTML protocols including necessary jars with runtimes settings:-Options:-Memorymanagement:-JavascriptRuntimeMemory changed to 2048.

Please confirm whether this is LR issue or Defect? and solution please...

Below is the generation error details:

Description Details:
Externalizable parsing failed: java.lang.OutOfMemoryError: Java heap space

Call stack can be found in Code Generation log.

Recommended Operation Details:
Check your java code and call stack.
0 Likes
10 Replies
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Error: Exception in java code, Check your java code and call stack

Title: How to workaround JVM heapsize limitation of LoadRunner (Rebasing Patch)
Document ID: KM792242
Product: LoadRunner
Version:
Updated: 2009-Nov-09
Summary: The application during recording/replay is demanding to use JVM heapsize which LoadRunner is currently unable to supply. Current limit is maximum of 300MB-500 MB. The rebasing patch will help to allow for a max heapsize of 800MB-1300MB depending on the computer.




Background Information:

Java Virtual Memory (JVM) requires continuous space while LoadRunner (LR) DLLs are loaded into lots of addresses in the memory and because of this, the memory looks like "Swiss cheese" without a large free continuous space.

To overcome this, there is a workaround that should be applied to all LG & Vugen machines. The rebasing patch rebases all the DLLs used by java record & replay to so there will be as much free continuous memory as possible.


Typical Issue Encountered during Vugen recording

During recording, the application is demanding to use JVM heapsize which Vugen is currently unable to supply, thus throwing error messages such as "Could not create the Java Virtual Machine".

However if try to start up the application during recording with a heapsize that is within LR limit (approximately 350MB), the application will fail to launch.


Possible Vugen Replay Error:

Unlike during recording where we are required to run the whole application, script replay usually only runs a subset of the application. Thus there is low possibility of reaching the JVM heapsize limitation.

However in extreme cases e.g. when running a large number of Vusers on the machine, the limitation may transform into OutOfMemoryException.





Solution

Workaround (during recording)

Apply the rebasing patch and try using the added space for VM via Recording Options, add to Java Environment Settings, under Java VM, Additional VM Parameters '-Xmx850m'. This will tell the VM to reserve a max of 850MB for heap space.


Workaround (during replay)

For such cases first try to set the limit to approximately 350MB. If LR scripts fail to run, then apply the patch and run with 850MB via Runtime Settings, add to Java Environment Settings, under Java VM, Additional VM Parameters '-Xmx850m'. This will tell the VM to reserve a max of 850MB for heap space.

â ¢This is not an official patch, and users will have to install it on every load generator manually
â ¢Prior to implementing this workaround the scripts must be check to determine what they are taking so much memory and whether it is justified
â ¢Different versions exists for LR 9.0, 9.1 and 9.5. Click the following links to see attached patches:
Clck here for Rebasing Patch LR90.zip

Clck here for Rebasing Patch LR91.zip

Click here for Rebasing Patch LR95, LR951.zip

IMPORTANT: Please refer to the specific patch readme/text document for instructions on how to apply it properly

-HTH
Cheers!

Nvr Blame a day in ur life....... Good day gives "happiness" & Bad day gives "experience" ......
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Error: Exception in java code, Check your java code and call stack

Hi HTH,

I am unable to click on the link to download the patch.

"Click here for Rebasing Patch LR95, LR951.zip"

Could you please provide me the patch zip file here to get it downloaded here itself.

thanks in advance
0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Error: Exception in java code, Check your java code and call stack

if u have hp account pls search for document id and download it
Cheers!

Nvr Blame a day in ur life....... Good day gives "happiness" & Bad day gives "experience" ......
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Error: Exception in java code, Check your java code and call stack

Hi,
Sorry for the delayed reply.

I have downloaded the 'Rebasing Patch LR95, LR951.zip' and installed and recorded the script again new with Web and Flex protocols.

Still the generation error remains same and the Generation Log displayed the following error details:

AMF warning: AMF: Externalizable parsing failed: com.thoughtworks.xstream.converters.ConversionException: Could not call flex.messaging.io.amf.ASObject.writeObject() : Could not call flex.messaging.io.amf.ASObject.writeObject() : Java heap space
---- Debugging information ----
message : Could not call flex.messaging.io.amf.ASObject.writeObject()
cause-exception : java.lang.OutOfMemoryError
cause-message : Java heap space
-------------------------------
message : Could not call flex.messaging.io.amf.ASObject.writeObject()
cause-exception : com.thoughtworks.xstream.converters.ConversionException
cause-message : Could not call flex.messaging.io.amf.ASObject.writeObject() : Java heap space
-------------------------------
at com.thoughtworks.xstream.converters.reflection.SerializationMethodInvoker.callWriteObject(SerializationMethodInvoker.java:103)
at com.thoughtworks.xstream.converters.reflection.SerializableConverter.doMarshal(SerializableConverter.java:205)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:54)
at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:65)
at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:63)
at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:63)
at com.thoughtworks.xstream.converters.collections.ArrayConverter.marshal(ArrayConverter.java:45)
at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:65)
at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:63)
at com.thoughtworks.xstream.converters.reflection.ExternalizableConverter$1.writeToStream(ExternalizableConverter.java:59)
at com.thoughtworks.xstream.core.util.CustomObjectOutputStream.writeObjectOverride(CustomObjectOutputStream.java:84)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
at flex.messaging.io.ArrayCollection.writeExternal(ArrayCollection.java:97)
at com.thoughtworks.xstream.converters.reflection.ExternalizableConverter.marshal(ExternalizableConverter.java:81)
at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:65)
at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:63)
at com.thoughtworks.xstream.converters.reflection.ExternalizableConverter$1.writeToStream(ExternalizableConverter.java:59)
at com.thoughtworks.xstream.core.util.CustomObjectOutputStream.writeObjectOverride(CustomObjectOutputStream.java:84)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
at flex.messaging.messages.AbstractMessage.writeExternal(AbstractMessage.java:353)
at flex.messaging.messages.AsyncMessage.writeExternal(AsyncMessage.java:140)
at flex.messaging.messages.AcknowledgeMessage.writeExternal(AcknowledgeMessage.java:93)
at flex.messaging.messages.AcknowledgeMessageExt.writeExternal(AcknowledgeMessageExt.java:57)
at com.thoughtworks.xstream.converters.reflection.ExternalizableConverter.marshal(ExternalizableConverter.java:81)
at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:65)
at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:63)
at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:98)
at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:38)
at com.thoughtworks.xstream.XStream.marshal(XStream.java:845)
at com.thoughtworks.xstream.XStream.marshal(XStream.java:834)
at com.thoughtworks.xstream.XStream.toXML(XStream.java:815)
at com.thoughtworks.xstream.XStream.toXML(XStream.java:805)
at hp.flex.HPExternalizableWrapper.ReadObject(HPExternalizableWrapper.java:116)
Caused by: com.thoughtworks.xstream.converters.ConversionException: Could not call flex.messaging.io.amf.ASObject.writeObject() : Java heap space
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Error: Exception in java code, Check your java code and call stack

Hi Venkat,

Kindly refer to KM 115370, you may want to try this.

Suggestively :
-Close all LR applications - Vugen, Controller, Analysis, agent
-Open flex_ro.ini from \dat in a notepad
-Add the following line under section [FLEX_RO] FlexJvmParams=-Xmx128m
-Launch vugen

Hope this helps.
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Error: Exception in java code, Check your java code and call stack

Hi,

I have treid with your solution i.e., [Flox_ro]- adding the specified line but still we are getting the same error.
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Error: Exception in java code, Check your java code and call stack

Hi,

Anybody help me in the regard...

I found the below error in replay log and in the generation error it shown as OutOfMemory error.

ction.c(31): Error: Encoding of AMF message failed. Error is : Exception Occurred while invoking WriteObject method - java.lang.IllegalArgumentException: XPP3 pull parser library not present. Specify another driver. For example: new XStream(new DomDriver())
at com.thoughtworks.xstream.io.xml.XppDriver.loadLibrary(XppDriver.java:62)
at com.thoughtworks.xstream.io.xml.XppDriver.createReader(XppDriver.java:43)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:853)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:845)
at hp.flex.HPExternalizableWrapper.WriteObject(HPExternalizableWrapper.java:47)
Action.c(31): There was an error during the FLEX AMF Call ("AMF3_call")
Ending action Action.
Ending iteration 1.
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Error: Exception in java code, Check your java code and call stack

What is the OS ver ?
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Error: Exception in java code, Check your java code and call stack

Microsoft Windows XP Professional v2002 SP3
Intel(R)Core(TM) Duo CPU E6550 @ 2.33GHz, 3.23GB of RAM
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Error: Exception in java code, Check your java code and call stack

I suggest you involve environment, development team to study the concern.
recheck with the application jars...
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.