Althor
unread,Mar 6, 2012, 6:40:52 AM3/6/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to gran...@googlegroups.com
Hi
I am having problems to send a actionscript object wich contains a IMap to the server.
My java class contains this attribute:
private Map<String, AttributeData> attributes = new HashMap<String, AttributeData>();
The generated AS class is:
package model.dto {
import flash.utils.IDataInput;
import flash.utils.IDataOutput;
import flash.utils.IExternalizable;
import org.granite.collections.IMap;
[Bindable]
public class AbstractBaseLdapDataBase implements IExternalizable {
private var _attributes:IMap;
private var _entryDN:String;
public function set attributes(value:IMap):void {
_attributes = value;
}
public function get attributes():IMap {
return _attributes;
}
public function get entryDN():String {
return _entryDN;
}
public function readExternal(input:IDataInput):void {
_attributes = input.readObject() as IMap;
_entryDN = input.readObject() as String;
}
public function writeExternal(output:IDataOutput):void {
output.writeObject(_attributes);
output.writeObject(_entryDN);
}
}
}
In the AS that I am able to modify I have added the following code to initialize the 'attributes' attribute:
public function AbstractBaseLdapData() {
this.attributes=new BasicMap();
}
My problem comes where I create a new object in flex and send it to the server. I am getting this exception:
Caused by:
org.granite.messaging.amf.io.convert.NoConverterFoundException: Cannot
convert: org.granite.collections.BasicMap
{vfesmangsmaid=[Ljava.lang.Object;@b455e0,
vfesmanid=[Ljava.lang.Object;@1721198} to:
java.util.HashMap<java.lang.String, model.dto.AttributeData>
at org.granite.messaging.amf.io.convert.Converters.getConverter(Converters.java:119)
at org.granite.messaging.amf.io.convert.Converters.convert(Converters.java:132)
at org.granite.messaging.amf.io.util.Property.convert(Property.java:60)
at org.granite.messaging.amf.io.util.FieldProperty.setProperty(FieldProperty.java:60)
The externalizer I am using is DefaultExternalizer.
When the server sends objects to the flex client the serialization and deserialization work success.
Can you help me?
Thanks in advance!