steeltomato / jmeter-amf

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

Errors while recording amf requests #34

Open maciejfranek opened 10 years ago

maciejfranek commented 10 years ago

Tried to record amf requests using AMF proxy server, but I have encountered following exceptions:


2014/05/12 22:37:51 ERROR - jmeter.protocol.amf.util.AmfXmlConverter: An exception was encountered while deserializing response.  flex.messaging.io.UnknownTypeException: ???10301???
    at flex.messaging.io.amf.Amf0Input.readObjectValue(Amf0Input.java:215)
    at flex.messaging.io.amf.Amf0Input.readObject(Amf0Input.java:95)
    at flex.messaging.io.amf.AmfMessageDeserializer.readObject(AmfMessageDeserializer.java:232)
    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.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:224)
Despite exceptions, amf requests were recorded, but content of a request was incomplete:

<ActionMessage>
<version>3</version>
<headers/>
<bodies>
  <MessageBody>
    <targetURI>null</targetURI>
    <responseURI>/1</responseURI>
  </MessageBody>
</bodies>
<ActionMessage>
After investigation, it was noted that blazeds can`t find object with type '-65'. This is weird as AMF has type identificators between 0 and 17 (see http://grepcode.com/file/repository.springsource.com/com.adobe.flex/com.springsource.flex.messaging/3.2.0.3978/flex/messaging/io/amf/AmfTypes.java). Further findings indicated that there is a bug in a proxy recorder. Conversion from amf to xml might be incorrect as encoded bytes are used to it - https://github.com/steeltomato/jmeter-amf/blob/master/src/protocol/amf/org/apache/jmeter/protocol/amf/proxy/AmfRequestHdr.java#L463 postData is encoded earlier - https://github.com/steeltomato/jmeter-amf/blob/master/src/protocol/amf/org/apache/jmeter/protocol/amf/proxy/AmfRequestHdr.java#L395 causing wrong type identifier (in my case '10' was changed to '-65') Replacing:

String xml = AmfXmlConverter.convertAmfMessageToXml(postData.getBytes());
To:

String xml = AmfXmlConverter.convertAmfMessageToXml(rawPostData);
Fixed this issue
zylbj commented 10 years ago

download your jars ,a new exception : ERROR - jmeter.protocol.amf.proxy.AmfProxy: Exception when processing sample java.lang.ArrayIndexOutOfBoundsException: -1 at ... ... at jmeter.protocol.amf.util.AmfXmlConverter.convertAmfMessageToXml(AmfXmlConverter.java:173) at jmeter.protocol.amf.util.AmfXmlConverter.convertAmfMessageToXml(AmfXmlConverter.java:140) ... ... at jmeter.protocol.amf.proxy.AmfProxy.run(AmfProxy.java:224) INFO- jmeter.samplers.SampleEvent: List of sample_variables: []

sample can't get amf's xml request