Closed GoogleCodeExporter closed 9 years ago
I make it work by comment following line 359:
// serializationPolicy.validateDeserialize(instanceClass);
Original comment by new.r...@gmail.com
on 8 Apr 2011 at 2:18
Hi
this is because of the inheritance of final members, when these are used on
runtime the >compile time< inherited values are used, instead of the Runtime
values!
the solution is to use reflection in the class loading to reflect the GWT
engine avaliable at run time
here is a piece of code to paste at head of the
AbstractSerializationStreamReader class:
public class SyncClientSerializationStreamReader extends
AbstractSerializationStreamReader {
public static int SERIALIZATION_STREAM_VERSION;//used for cross gwt version compatibility as the compiled file imports the GWT version directly into the file
public static int SERIALIZATION_STREAM_MIN_VERSION;
//public static char RPC_SEPARATOR_CHAR;
static {
try {
SERIALIZATION_STREAM_VERSION = AbstractSerializationStreamReader.class.getField("SERIALIZATION_STREAM_VERSION").getInt(null);
SERIALIZATION_STREAM_MIN_VERSION = AbstractSerializationStreamReader.class.getField("SERIALIZATION_STREAM_MIN_VERSION").getInt(null);
//RPC_SEPARATOR_CHAR=AbstractSerializationStreamReader.class.getField("RPC_SEPARATOR_CHAR").getChar(null);
}
catch (Exception e) {
}
}
==============================
another piece of code you might want to replace is at the prepareToRead method:
the updated method allow the use of versions between the
MIN_SERIALIZATION_VERSION & SERIALIZATION_VERSION while the original only
allowed SERIALIZATION_VERSION
public void prepareToRead(String encoded) throws SerializationException {
parse(encoded);
index = results.size();
super.prepareToRead(encoded);
if (getVersion()<SERIALIZATION_STREAM_MIN_VERSION ||
getVersion() >SERIALIZATION_STREAM_VERSION) {
throw new IncompatibleRemoteServiceException("Expecting version between "
+ SERIALIZATION_STREAM_MIN_VERSION + " and "
+ SERIALIZATION_STREAM_VERSION + " from client, got " + getVersion()
+ ".");
}
buildStringTable();
}
Roi Rosenthal
Original comment by roi...@gmail.com
on 28 Aug 2011 at 12:13
This issue was closed by revision r52.
Original comment by gwtdevel...@gmail.com
on 30 Aug 2011 at 12:21
Original issue reported on code.google.com by
srinivas...@gmail.com
on 23 Mar 2011 at 5:42