I have developed several GWT Web Applications. Latest one is a little modification of another one. All of them works well except for the latest one. The exception is:
The response could not be deserialized
I am using Hibernate and Data Transfer Objects between Hibernate and GWT. Each DTO implements java.io.Serializable interface. As I said before, in other applications works well. Could someone help me with this error? I do not know what the cause is.
My Hibernate object code is:
public List<AttributeDTO> getAttributes(){
String sql = "from Attribute where (select max(tDate) from Attribute)-tDate < '0 days 00:05'";
List<Attribute> attributes = new ArrayList<Attribute>(DatabaseManager.createQuery(sql));
List<AttributeDTO> attributeDTOs = new ArrayList<AttributeDTO>(attributes != null ? attributes.size() : 0);
if (attributes != null) {
for (Attribute attribute : attributes) {
String date = format.format(attribute.gettDate());
attributeDTOs.add(new AttributeDTO(attribute.getiAttrId(),attribute.getsName(),attribute.getsValue(),date,attribute.getiDeviceId(),attribute.getsUnits(),new ApplicationFieldDTO()));
}
}
return attributeDTOs;
}
And AttributeDTO is:
public class AttributeDTO implements Serializable {
private static final long serialVersionUID = 1L;
private int iAttrId;
private String name;
private String value;
private String date;
private String units;
private int iDeviceId;
private ApplicationFieldDTO appField;
public AttributeDTO() {}
public AttributeDTO(int attrId, String name, String value, String date, int deviceId, String units, ApplicationFieldDTO appField) {
this.iAttrId = attrId;
this.name = name;
this.value = value;
this.date = date;
this.iDeviceId = deviceId;
this.units = units;
this.appField = appField;
}
}
From GWT is call getAttributes() method which returns a List of AttributeDTO.
Thanks!!!