Hi all,
The basic stuff is all there: I tried IsSerializable instead, it has a public empty default constructor and i narrowed it down from List to ArrayList... Normally i would expect the link guestOSDTO to cause a problem, but all is fine until i try to add the list of strings.
-- i got a strange issue i hope you can help me with:
I have a DTO which carries around some strings and which works fine.
As soon as i add these lines to it, i get a IncompatibleRemoteServiceException, founding on a SerializationException:
protected ArrayList<String> groupList = new ArrayList<String>();
public ArrayList<String> getGroupList() {
return groupList;
}
public void setGroupList(ArrayList<String> groupList) {
this.groupList = groupList;
}The basic stuff is all there: I tried IsSerializable instead, it has a public empty default constructor and i narrowed it down from List to ArrayList... Normally i would expect the link guestOSDTO to cause a problem, but all is fine until i try to add the list of strings.
Here is the DTO in its full glory:
public class ContainerDto implements Serializable {
private static final long serialVersionUID = 5251004363721643201L;
protected Integer id;
protected String uuid;
protected String name;
protected String phoneNumber;
protected GuestOSDTO guestOSDTO;
protected String groups;
protected ArrayList<String> groupList = new ArrayList<String>();
public ArrayList<String> getGroupList() {
return groupList;
}
public void setGroupList(ArrayList<String> groupList) {
this.groupList = groupList;
}
protected DeviceDto device;
protected String userAuthCertificate;
protected String userEncCertificate;
protected String user;
/*
* Constructors (generated)
*/
public ContainerDto() {
}
public ContainerDto(Integer id, String uuid, String name, String phoneNumber, GuestOSDTO guestOSDTO, String groups, DeviceDto device,
String userAuthCertificate, String userEncCertificate, String user) {
super();
this.id = id;
this.uuid = uuid;
this.name = name;
this.phoneNumber = phoneNumber;
this.guestOSDTO = guestOSDTO;
this.groups = groups;
this.device = device;
this.userAuthCertificate = userAuthCertificate;
this.userEncCertificate = userEncCertificate;
this.user = user;
}
/*
* Getters & setters (generated)
*/
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
public GuestOSDTO getGuestOSDTO() {
return guestOSDTO;
}
public void setGuestOSDTO(GuestOSDTO guestOSDTO) {
this.guestOSDTO = guestOSDTO;
}
public DeviceDto getDevice() {
return device;
}
public void setDevice(DeviceDto device) {
this.device = device;
}
public String getUserAuthCertificate() {
return userAuthCertificate;
}
public void setUserAuthCertificate(String userAuthCertificate) {
this.userAuthCertificate = userAuthCertificate;
}
public String getUserEncCertificate() {
return userEncCertificate;
}
public void setUserEncCertificate(String userEncCertificate) {
this.userEncCertificate = userEncCertificate;
}
public String getUser() {
return user;
}
public void setUser(String user) {
this.user = user;
}
public String getGroups() {
return groups;
}
public void setGroups(String groups) {
this.groups = groups;
}
/*
* Getters and Setters to make it back compatible // TODO review those
* methods
*/
public String getImei() {
return new Long(this.getDevice().getImei()).toString();
}
public String getType() {
// TODO put this in the GuestOSDTO??
return this.getGuestOSDTO().getOsKey() + "_" + this.getGuestOSDTO().getVersion();
}
/*
* Other methods (generated)
*/
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("ContainerDto [id=").append(id).append(", uuid=").append(uuid).append(", name=").append(name).append(", phoneNumber=")
.append(phoneNumber).append(", guestOSDTO=").append(guestOSDTO).append(", groups=").append(groups).append(", device=").append(device)
.append(", userAuthCertificate=").append(userAuthCertificate).append(", userEncCertificate=").append(userEncCertificate).append(", user=")
.append(user).append("]");
return builder.toString();
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((device == null) ? 0 : device.hashCode());
result = prime * result + ((groups == null) ? 0 : groups.hashCode());
result = prime * result + ((guestOSDTO == null) ? 0 : guestOSDTO.hashCode());
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((phoneNumber == null) ? 0 : phoneNumber.hashCode());
result = prime * result + ((user == null) ? 0 : user.hashCode());
result = prime * result + ((userAuthCertificate == null) ? 0 : userAuthCertificate.hashCode());
result = prime * result + ((userEncCertificate == null) ? 0 : userEncCertificate.hashCode());
result = prime * result + ((uuid == null) ? 0 : uuid.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
ContainerDto other = (ContainerDto) obj;
if (device == null) {
if (other.device != null) {
return false;
}
} else if (!device.equals(other.device)) {
return false;
}
if (groups == null) {
if (other.groups != null) {
return false;
}
} else if (!groups.equals(other.groups)) {
return false;
}
if (guestOSDTO == null) {
if (other.guestOSDTO != null) {
return false;
}
} else if (!guestOSDTO.equals(other.guestOSDTO)) {
return false;
}
if (id == null) {
if (other.id != null) {
return false;
}
} else if (!id.equals(other.id)) {
return false;
}
if (name == null) {
if (other.name != null) {
return false;
}
} else if (!name.equals(other.name)) {
return false;
}
if (phoneNumber == null) {
if (other.phoneNumber != null) {
return false;
}
} else if (!phoneNumber.equals(other.phoneNumber)) {
return false;
}
if (user == null) {
if (other.user != null) {
return false;
}
} else if (!user.equals(other.user)) {
return false;
}
if (userAuthCertificate == null) {
if (other.userAuthCertificate != null) {
return false;
}
} else if (!userAuthCertificate.equals(other.userAuthCertificate)) {
return false;
}
if (userEncCertificate == null) {
if (other.userEncCertificate != null) {
return false;
}
} else if (!userEncCertificate.equals(other.userEncCertificate)) {
return false;
}
if (uuid == null) {
if (other.uuid != null) {
return false;
}
} else if (!uuid.equals(other.uuid)) {
return false;
}
return true;
}
}Do you have any idea what causes the problem?
Thanks!
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment