Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Riena » Java 5 Enums / Hessian / Riena
Java 5 Enums / Hessian / Riena [message #584054] Mon, 09 November 2009 07:28
Jens Mayer is currently offline Jens Mayer
Messages: 19
Registered: September 2009
Location: Hamburg
Junior Member
Hi,

I encountered a com.caucho.hessian.io.HessianFieldException when I tried to use a DTO which owns an Enum.

This is the Enum:


public enum BelegTyp {

Lieferschein("LIEFERUNG"),
Retoure("RETOURE"),
Rechnung("REKO");

private final static Map<String,BelegTyp> map = new HashMap<String,BelegTyp>();
private final String value;

private BelegTyp (String val){
this.value = val;
}

public String getValue() {
return value;
}

@Override
public String toString() {
return value;
}
}



... this is the DTO which owns the Enum:


public class DTOBeleg {
protected BelegTyp typ;

public BelegTyp getTyp() {
return typ;
}

public void setTyp(BelegTyp typ) {
this.typ = typ;
}
}



... and this is the DTO which has to be transferred:


public class DTOLieferschein extends DTOBeleg {

private String lieferscheinNr;

(...)

public String getLieferscheinNr() {
return lieferscheinNr;
}

public void setLieferscheinNr(String lieferscheinNr) {
this.lieferscheinNr = lieferscheinNr;
}

(...)
}


On the client-side the following exception is fired during deserialization:


Caused by: com.caucho.hessian.io.HessianFieldException: de.myapp.common.we.DTOBeleg.typ: de.myapp.common.we.DTOLieferschein (DTOLieferschein [allbel_id=0, lieferscheinNr=00039023]) cannot be assigned to de.myapp.common.we.BelegTyp
at com.caucho.hessian.io.JavaDeserializer.logDeserializeError(J avaDeserializer.java:589)
at com.caucho.hessian.io.JavaDeserializer$ObjectFieldDeserializ er.deserialize(JavaDeserializer.java:387)
at com.caucho.hessian.io.JavaDeserializer.readObject(JavaDeseri alizer.java:233)
at com.caucho.hessian.io.JavaDeserializer.readObject(JavaDeseri alizer.java:157)
at com.caucho.hessian.io.SerializerFactory.readObject(Serialize rFactory.java:364)
at com.caucho.hessian.io.Hessian2Input.readObjectInstance(Hessi an2Input.java:2017)
at com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input .java:1943)
at com.caucho.hessian.io.CollectionDeserializer.readList(Collec tionDeserializer.java:78)
at com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input .java:1666)
at com.caucho.hessian.client.HessianProxy.invoke(HessianProxy.j ava:201)
... 36 more



I know that there were some issues with hessian and Java5-Enums in former versions of hessian (3.0.x)
Riena 1.1.0 uses Hessian 3.1.3, right ? So Enums should be supported.

Can anybody tell me how to avoid these errors?
Previous Topic:Using SSLConfiguration
Next Topic:Using SSLConfiguration
Goto Forum:
  


Current Time: Mon Jul 28 18:43:51 EDT 2014

Powered by FUDForum. Page generated in 0.01652 seconds