Hello guys!
I am using GWT-1.6 + gwt-ext-2.0.5 + gilead (previous name is
hibernate4gwt).
I encountered next problem:
I am getting next exception when sending to the client an instance of
class bellow which extends form LightEntity:
com.google.gwt.dev.shell.HostedModeException: Expected primitive type
int; actual value was undefined
at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:51)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeInt
(ModuleSpace.java:209)
at
com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader.readInt
(Native Method)
at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject
(AbstractSerializationStreamReader.java:46)
at net.sf.gilead.pojo.java5.LightEntity_FieldSerializer.deserialize
(LightEntity_FieldSerializer.java:5)
at by.orwest.oms.core.entity.Insurance_FieldSerializer.deserialize
(Insurance_FieldSerializer.java:91)
at
by.orwest.oms.gwt.client.rpc.IInsuranceRemote_TypeSerializer.deserialize
(Native Method)
at
com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader.deserialize
(ClientSerializationStreamReader.java:116)
Here is my class:
@Entity
@Table(name="INSURANCE")
public class Insurance extends LightEntity implements Serializable
{
private long id;
private String sn;
private Date createdDate;
private Date startDate;
private Date endDate;
private String insuranceCompany;
private String insurer;
private long price;
private String comment;
public Insurance() {
}
@Id
@GeneratedValue
@Column(name="ID")
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Column(name="SN",unique = true, nullable = true, length = 20)
public String getSN() {
return sn;
}
public void setSN(String sn) {
this.sn = sn;
}
@Column(name="CREATED_DATE", nullable = true)
@Temporal(TemporalType.DATE)
public Date getCreatedDate() {
return createdDate;
}
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
@Column(name="START_DATE", nullable = false)
@Temporal(TemporalType.DATE)
public Date getStartDate() {
return startDate;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
@Column(name="END_DATE", nullable = false)
@Temporal(TemporalType.DATE)
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
@Column(name="INSURANCE_COMPANY", nullable = true, length = 30)
public String getInsuranceCompany() {
return insuranceCompany;
}
public void setInsuranceCompany(String insuranceCompany) {
this.insuranceCompany = insuranceCompany;
}
@Column(name="INSURER", nullable = true, length = 30)
public String getInsurer() {
return insurer;
}
public void setInsurer(String insurer) {
this.insurer = insurer;
}
@Column(name="PRICE", nullable = true)
public long getPrice() {
return price;
}
public void setPrice(long price) {
this.price = price;
}
@Column(name="COMMENT", nullable = true, length = 400)
public String getComment() {
return comment;
}
public void setComment(String comment) {
this.comment = comment;
}
}
LightEntity is abstract class from gilead library (adapter-core.jar).
It is serializable class which contains only one protected field
Map<String,String>
public abstract class LightEntity implements ILightEntity,
Serializable
{
private static final long serialVersionUID = 1061336746068017740L;
protected Map<String, String> _proxyInformations;
public Map<String, String> getProxyInformations()
{
return _proxyInformations;
}
@SuppressWarnings("unchecked")
public void setProxyInformations(Map informations)
{
_proxyInformations = informations;
}
public LightEntity()
{
super();
}
public void addProxyInformation(String property,
String
proxyInfo)
{...}
public void removeProxyInformation(String property)
{... }
public String getProxyInformation(String property)
{... }
public String getDebugString()
{... }
}
I now that the problem in deserialization process of
Map<String,String> field. But I don't understand the reason?
I found out that this problem reproduced only in hosted mode. In
browser it works fine.
Any ideas how to fix it?
Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---