steeltomato / jmeter-amf

AMF Plugin for JMeter
http://code.kennethjhill.com/jmeter-amf
Apache License 2.0
37 stars 37 forks source link

Error in deserializing response of AMF request from XML to back AMF #19

Open amandv opened 12 years ago

amandv commented 12 years ago

jmeter.protocol.amf.util.AmfXmlConverter: An exception was encountered while deserializing response. flex.messaging.io.SerializationException: Class 'flex.messaging.io.amf.ASObject' must implement java.io.Externalizable to receive client IExternalizable instances. at flex.messaging.io.amf.Amf3Input.readExternalizable(Amf3Input.java:496) at flex.messaging.io.amf.Amf3Input.readScriptObject(Amf3Input.java:420) at flex.messaging.io.amf.Amf3Input.readObjectValue(Amf3Input.java:152) at flex.messaging.io.amf.Amf3Input.readObject(Amf3Input.java:130) at flex.messaging.io.amf.Amf0Input.readObjectValue(Amf0Input.java:123) at flex.messaging.io.amf.Amf0Input.readArrayValue(Amf0Input.java:359) at flex.messaging.io.amf.Amf0Input.readObjectValue(Amf0Input.java:127) at flex.messaging.io.amf.Amf0Input.readObject(Amf0Input.java:94) at flex.messaging.io.amf.AmfMessageDeserializer.readObject(AmfMessageDeserializer.java:227) at flex.messaging.io.amf.AmfMessageDeserializer.readBody(AmfMessageDeserializer.java:206) at flex.messaging.io.amf.AmfMessageDeserializer.readMessage(AmfMessageDeserializer.java:126) at org.apache.jmeter.protocol.amf.util.AmfXmlConverter.convertAmfMessageToXml(AmfXmlConverter.java:163) at org.apache.jmeter.protocol.amf.proxy.AmfRequestHdr.populateSampler(AmfRequestHdr.java:463) at org.apache.jmeter.protocol.amf.proxy.AmfRequestHdr.getSampler(AmfRequestHdr.java:281) at org.apache.jmeter.protocol.amf.proxy.AmfProxy.run(AmfProxy.java:229)

2011/12/20 12:25:43 ERROR - jmeter.protocol.amf.util.AmfXmlConverter: An exception was encountered while deserializing response. flex.messaging.io.SerializationException: Class 'flex.messaging.io.amf.ASObject' must implement java.io.Externalizable to receive client IExternalizable instances. at flex.messaging.io.amf.Amf3Input.readExternalizable(Amf3Input.java:496) at flex.messaging.io.amf.Amf3Input.readScriptObject(Amf3Input.java:420) at flex.messaging.io.amf.Amf3Input.readObjectValue(Amf3Input.java:152) at flex.messaging.io.amf.Amf3Input.readObject(Amf3Input.java:130) at flex.messaging.io.amf.Amf0Input.readObjectValue(Amf0Input.java:123) at flex.messaging.io.amf.Amf0Input.readArrayValue(Amf0Input.java:359) at flex.messaging.io.amf.Amf0Input.readObjectValue(Amf0Input.java:127) at flex.messaging.io.amf.Amf0Input.readObject(Amf0Input.java:94) at flex.messaging.io.amf.AmfMessageDeserializer.readObject(AmfMessageDeserializer.java:227) at flex.messaging.io.amf.AmfMessageDeserializer.readBody(AmfMessageDeserializer.java:206) at flex.messaging.io.amf.AmfMessageDeserializer.readMessage(AmfMessageDeserializer.java:126) at org.apache.jmeter.protocol.amf.util.AmfXmlConverter.convertAmfMessageToXml(AmfXmlConverter.java:163) at org.apache.jmeter.protocol.amf.proxy.AmfRequestHdr.populateSampler(AmfRequestHdr.java:463) at org.apache.jmeter.protocol.amf.proxy.AmfRequestHdr.getSampler(AmfRequestHdr.java:281) at org.apache.jmeter.protocol.amf.proxy.AmfProxy.run(AmfProxy.java:229)

2011/12/20 12:25:58 ERROR - jmeter.protocol.amf.util.AmfXmlConverter: An exception was encountered while deserializing response. flex.messaging.io.SerializationException: Class 'flex.messaging.io.amf.ASObject' must implement java.io.Externalizable to receive client IExternalizable instances. at flex.messaging.io.amf.Amf3Input.readExternalizable(Amf3Input.java:496) at flex.messaging.io.amf.Amf3Input.readScriptObject(Amf3Input.java:420) at flex.messaging.io.amf.Amf3Input.readObjectValue(Amf3Input.java:152) at flex.messaging.io.amf.Amf3Input.readObject(Amf3Input.java:130) at flex.messaging.io.amf.Amf0Input.readObjectValue(Amf0Input.java:123) at flex.messaging.io.amf.Amf0Input.readArrayValue(Amf0Input.java:359) at flex.messaging.io.amf.Amf0Input.readObjectValue(Amf0Input.java:127) at flex.messaging.io.amf.Amf0Input.readObject(Amf0Input.java:94) at flex.messaging.io.amf.AmfMessageDeserializer.readObject(AmfMessageDeserializer.java:227) at flex.messaging.io.amf.AmfMessageDeserializer.readBody(AmfMessageDeserializer.java:206) at flex.messaging.io.amf.AmfMessageDeserializer.readMessage(AmfMessageDeserializer.java:126) at org.apache.jmeter.protocol.amf.util.AmfXmlConverter.convertAmfMessageToXml(AmfXmlConverter.java:163) at org.apache.jmeter.protocol.amf.proxy.AmfRequestHdr.populateSampler(AmfRequestHdr.java:463) at org.apache.jmeter.protocol.amf.proxy.AmfRequestHdr.getSampler(AmfRequestHdr.java:281) at org.apache.jmeter.protocol.amf.proxy.AmfProxy.run(AmfProxy.java:229)

amandv commented 12 years ago

Tried using different options of encoding formats such as below:

C:\jakarta-jmeter-2.5.1\bin>jmeter -Dfile.encoding=UTF-8 Uncaught Exception java.lang.IndexOutOfBoundsException: Index: 1, Size: 0. See l og file for details. Uncaught Exception java.lang.IndexOutOfBoundsException: Index: 2, Size: 1. See l og file for details. Uncaught Exception java.lang.IndexOutOfBoundsException: Index: 2, Size: 0. See l og file for details.

C:\jakarta-jmeter-2.5.1\bin>jmeter "-Dfile.encoding=UTF-8" Uncaught Exception java.lang.IndexOutOfBoundsException: Index: 0, Size: 0. See l og file for details. Uncaught Exception java.lang.IndexOutOfBoundsException: Index: 2, Size: 0. See l og file for details.

C:\jakarta-jmeter-2.5.1\bin> C:\jakarta-jmeter-2.5.1\bin> C:\jakarta-jmeter-2.5.1\bin> C:\jakarta-jmeter-2.5.1\bin> C:\jakarta-jmeter-2.5.1\bin> C:\jakarta-jmeter-2.5.1\bin>jmeter "-Dfile.encoding=gzip,deflate"

C:\jakarta-jmeter-2.5.1\bin>jmeter "-Dfile.encoding=gzip,deflate"

bobhttp commented 10 years ago

please guide me to rectify this error..

59 ERROR - jmeter.protocol.amf.util.AmfXmlConverter: An exception was encountered while deserializing response. flex.messaging.io.SerializationException: Class 'flex.messaging.io.amf.ASObject' must implement java.io.Externalizable to receive client IExternalizable instances. at flex.messaging.io.amf.Amf3Input.readExternalizable(Amf3Input.java:496) at flex.messaging.io.amf.Amf3Input.readScriptObject(Amf3Input.java:420) at flex.messaging.io.amf.Amf3Input.readObjectValue(Amf3Input.java:152) at flex.messaging.io.amf.Amf3Input.readObject(Amf3Input.java:130) at flex.messaging.io.amf.Amf0Input.readObjectValue(Amf0Input.java:123) at flex.messaging.io.amf.Amf0Input.readObject(Amf0Input.java:94) at flex.messaging.io.amf.AmfMessageDeserializer.readObject(AmfMessageDeserializer.java:227) at flex.messaging.io.amf.AmfMessageDeserializer.readBody(AmfMessageDeserializer.java:206) at flex.messaging.io.amf.AmfMessageDeserializer.readMessage(AmfMessageDeserializer.java:126) at org.apache.jmeter.protocol.amf.util.AmfXmlConverter.convertAmfMessageToXml(AmfXmlConverter.java:168) at org.apache.jmeter.protocol.amf.util.AmfXmlConverter.convertAmfMessageToXml(AmfXmlConverter.java:140) at org.apache.jmeter.protocol.amf.visualizers.RenderAsAMF.renderResult(RenderAsAMF.java:43) at org.apache.jmeter.visualizers.ViewResultsFullVisualizer.valueChanged(ViewResultsFullVisualizer.java:253) at javax.swing.JTree.fireValueChanged(JTree.java:2919) at javax.swing.JTree$TreeSelectionRedirector.valueChanged(JTree.java:3378) at javax.swing.tree.DefaultTreeSelectionModel.fireValueChanged(DefaultTreeSelectionModel.java:634) at javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(DefaultTreeSelectionModel.java:1092) at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPaths(DefaultTreeSelectionModel.java:293) at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPath(DefaultTreeSelectionModel.java:187) at javax.swing.JTree.setSelectionPath(JTree.java:1631) at javax.swing.plaf.basic.BasicTreeUI.selectPathForEvent(BasicTreeUI.java:2395) at javax.swing.plaf.basic.BasicTreeUI$Handler.handleSelection(BasicTreeUI.java:3611) at javax.swing.plaf.basic.BasicTreeUI$Handler.mousePressed(BasicTreeUI.java:3550) at java.awt.Component.processMouseEvent(Component.java:6502) at javax.swing.JComponent.processMouseEvent(JComponent.java:3311) at java.awt.Component.processEvent(Component.java:6270) at java.awt.Container.processEvent(Container.java:2229) at java.awt.Component.dispatchEventImpl(Component.java:4861) at java.awt.Container.dispatchEventImpl(Container.java:2287) at java.awt.Component.dispatchEvent(Component.java:4687) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4489) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422) at java.awt.Container.dispatchEventImpl(Container.java:2273) at java.awt.Window.dispatchEventImpl(Window.java:2719) at java.awt.Component.dispatchEvent(Component.java:4687) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735) at java.awt.EventQueue.access$200(EventQueue.java:103) at java.awt.EventQueue$3.run(EventQueue.java:694) at java.awt.EventQueue$3.run(EventQueue.java:692) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87) at java.awt.EventQueue$4.run(EventQueue.java:708) at java.awt.EventQueue$4.run(EventQueue.java:706) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:705) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138) at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

maciejfranek commented 10 years ago

Hi, Did you copy any classes or jar files from your server to $JMETER/lib/ext directory? If not, then it might be your issue - Why are properties and objects missing from the request or response XML.

bobhttp commented 10 years ago

Hi, Yes I have already copied jar files given by client to the $JMETER/lib/ext directory.Still the properties and objects missing from the request or response XML and jmeter log record the above mention error

maciejfranek commented 10 years ago

Did you have similar errors during recording? Please, try https://github.com/maciejfranek/jmeter-amf - I have forked project to apply some fixes. There was also issue related to amf to xml conversion (Issue 34) and fix for that is also included.

You can try also these flex messages jars (https://github.com/maciejfranek/jmeter-amf/tree/master/flex-jars)

bobhttp commented 10 years ago

Thank You for your help and support. No I do not have any errors during recording.I have tried the flex messages jar which you have told but still the issue remain the same.Can you please provide the jar file of your jmter-amf plugin.Thanks in advance.

maciejfranek commented 10 years ago

Please, find it here: https://github.com/maciejfranek/jmeter-amf/tree/master/dist-jar You may try record again your script with this plugin.

You can look at server if there are some exceptions after you run your script.

Often issue is, when new version of server application is released. Then all jars has to be copied again to jmeter. I forgot about that few times and lost much time.

Best thing would be to reproduce your issue. Can you provide an example script with all necessary libraries?

bobhttp commented 10 years ago

Thank You for the jar file. I tried to record the script again with the new jmeter-amf jar file.But I get the following error during recording -ERROR - jmeter.JMeter: Uncaught exception: java.lang.NullPointerException at org.apache.jmeter.protocol.amf.proxy.AmfProxyControl.deliverSampler(AmfProxyControl.java:433) at org.apache.jmeter.protocol.amf.proxy.AmfProxy.run(AmfProxy.java:315)

maciejfranek commented 10 years ago

What is your recording configuration - do you have HTTP Request Defaults element? Check if it is correctly configured - hostname, port etc. Are you recording http or https?

Can you remove exclude and include patterns and try again?

bobhttp commented 10 years ago

Thanks I am able to view the response in XML form with the help of your flex jar files and amf-sampler.jar and orignal java-amf.jar file. I want to see the request sent to server on running the script.Can you please tell me the method to do the same.Thank you in advance

maciejfranek commented 10 years ago

Please, list your additional jars that you are using now (with full names).

I understand that you no longer encounter exception that you provided as your first post? It would be better if you use only one jmeter-amf-*.jar file. Plesase remove old ones and check if your case still works.

Answering your question - check Request tab in View Results Tree listener. For sure it display request in my version of plugin.

bobhttp commented 10 years ago

Additional jars- blazeds-common-3.0.0.544.jar blazeds-core-4.0.0.14931.jar flex-messaging-common-4.5.0.0-20120904.134031-2.jar flex-messaging-core-4.5.0.0-20120904.134035-2.jar flex-messaging-remoting-4.5.0.0-20120904.134038-2.jar flex-messaging-opt.jar flex-messaging-proxy.jar JMeter-AMF-v1.4.tar.gz---Jmeter-AMF.jar jmeter_amfsampler-1.0.3.jar jar files given by client Add JVM_ARGS="-Dfile.encoding=ISO-8859-1" in Jmeter bash file

I am using only one jmeter-amf-*.jar file ie. JMeter-AMF-v1.4.tar.gz but I am not able to record with your version of plugin.Can you please provide any other method to see the amf request in view result tree.

maciejfranek commented 10 years ago

My recommendation is to remove following jars: blazeds-common-3.0.0.544.jar blazeds-core-4.0.0.14931.jar

I think these also you can remove: flex-messaging-opt.jar flex-messaging-proxy.jar jmeter_amfsampler-1.0.3.jar - I dont know what it is, but if you dont need it then remove it also.

Then please, check if recording works.

IXEguy commented 9 years ago

Sorry to ressurect an old thread!

@maciejfranek: I followed your instructions to @bobhttp & I am unable to record as well.

I am only using your flex jars & your 1.5 version. I do not see "AMF Request Defaults" option in the Config Elements, nor the "AMF Proxy Server" option as I was with the Steel Tomato Version

_OS_: Windows 7 64-bit _JMeter version_: 2.13 r1665067

My ext folder looks like this:

ApacheJMeter_components.jar
ApacheJMeter_core.jar
ApacheJMeter_ftp.jar
ApacheJMeter_functions.jar
ApacheJMeter_http.jar
ApacheJMeter_java.jar
ApacheJMeter_jdbc.jar
ApacheJMeter_jms.jar
ApacheJMeter_junit.jar
ApacheJMeter_ldap.jar
ApacheJMeter_mail.jar
ApacheJMeter_mongodb.jar
ApacheJMeter_monitors.jar
ApacheJMeter_native.jar
ApacheJMeter_tcp.jar
***
flex-messaging-common-4.5.0.0-20120904.134031-2.jar
flex-messaging-core-4.5.0.0-20120904.134035-2.jar
flex-messaging-remoting-4.5.0.0-20120904.134038-2.jar
jmeter-amf-1.5.jar
***

Any suggestions?

edit: One more thing that I noticed was, I tried to rename jmeter-amf-1.5.jar to jmeter-amf.jar & it allowed me to do so, even though jmeter was running. Usually it complains about the file being used. Not sure if JMeter is not loading the file for some reason.

maciejfranek commented 9 years ago

Try with older version of jmeter. 2.11 or 2.12 Watch out for java 8, this also can make problems, try with jdk7.

IXEguy commented 9 years ago

@maciejfranek Thanks for the quick response!

I just tried with JMeter 2.12 and java version "1.7.0_79" & got the same results.

I went through the log for this installation & looked for AMF and found the following:

2015/06/19 09:16:32 WARN  - jorphan.reflect.ClassFinder: Can not open the jar C:/Users/xxx/Downloads/JMeter/apache-jmeter-2.12/lib/ext/jmeter-amf-1.5.jar error in opening zip file java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(Unknown Source)
    at java.util.zip.ZipFile.<init>(Unknown Source)
    at java.util.zip.ZipFile.<init>(Unknown Source)
    at org.apache.jorphan.reflect.ClassFinder.findClassesInOnePath(ClassFinder.java:527)
    at org.apache.jorphan.reflect.ClassFinder.findClassesInPaths(ClassFinder.java:548)
    at org.apache.jorphan.reflect.ClassFinder.findClassesThatExtend(ClassFinder.java:291)
    at org.apache.jmeter.gui.action.ActionRouter.populateCommandMap(ActionRouter.java:257)
    at org.apache.jmeter.gui.action.ActionRouter.getInstance(ActionRouter.java:300)
    at org.apache.jmeter.JMeter.startGui(JMeter.java:231)
    at org.apache.jmeter.JMeter.start(JMeter.java:380)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.jmeter.NewDriver.main(NewDriver.java:259)

Looking through the log, the other 3 flex jars also have similar errors in the log.

maciejfranek commented 9 years ago

When I download jar using RMB -> Save link as ... - I get the same exception. Try to download all jars again using "View raw" link.

IXEguy commented 9 years ago

Thanks! Will try again on Monday when I am back in the office and report back.