Permalink
Browse files

Alias registry is just causing problems, don't use it for now

  • Loading branch information...
1 parent cfea6f3 commit b2dd64b46bd799b8e030d76483f8e611248d89e2 @steeltomato committed Oct 25, 2011
Showing with 10 additions and 5 deletions.
  1. +0 −1 .classpath
  2. +1 −0 .gitignore
  3. +9 −4 src/protocol/amf/org/apache/jmeter/protocol/amf/util/AmfXmlConverter.java
View
@@ -65,6 +65,5 @@
<classpathentry kind="lib" path="lib/ext/ApacheJMeter_tcp.jar"/>
<classpathentry kind="lib" path="lib/junit/test.jar"/>
<classpathentry kind="lib" path="lib/ext/JMeterPlugins.jar"/>
- <classpathentry combineaccessrules="false" kind="src" path="/WebServices"/>
<classpathentry kind="output" path="build"/>
</classpath>
View
@@ -3,3 +3,4 @@
/.DS_Store
/dist/
/build/
+/*.log
@@ -137,15 +137,20 @@ public static String convertAmfToXml(byte[] amf) {
* Converts complete AMF message to XML representation
*/
public static String convertAmfMessageToXml(byte[] amf) {
+ return AmfXmlConverter.convertAmfMessageToXml(amf, false);
+ }
+ public static String convertAmfMessageToXml(byte[] amf, boolean useAliasRegistry) {
XStream xs = getXStream();
ActionContext actionContext = new ActionContext();
SerializationContext serializationContext = new SerializationContext();
// Class aliases for deserialization, mimics registerClassAlias in Flex
- // TODO: Allow user configuration
- ClassAliasRegistry aliases = ClassAliasRegistry.getRegistry();
- //aliases.registerAlias("DSC", "flex.messaging.messages.CommandMessageExt"); // This causes errors in XStream during sampling (cannot cast byte to string)
- aliases.registerAlias("DSK", "flex.messaging.messages.AcknowledgeMessageExt");
+ // Generally only used in rendering as it can cause serious problems for proxy sampling
+ if (useAliasRegistry) {
+ ClassAliasRegistry aliases = ClassAliasRegistry.getRegistry();
+ aliases.registerAlias("DSC", "flex.messaging.messages.CommandMessageExt"); // This causes errors in XStream during proxy sampling (cannot cast byte to string)
+ aliases.registerAlias("DSK", "flex.messaging.messages.AcknowledgeMessageExt");
+ }
// TODO: Maybe allow user configuration
serializationContext.createASObjectForMissingType = true;

0 comments on commit b2dd64b

Please sign in to comment.