-
1. Re: String size limit in ObjectMessage
genman Jan 6, 2004 12:52 AM (in response to jeanperrot)
I hear that JVM 1.3 may have problems deserializing strings > 64K in length. I think you can convert the property to bytes and back manually to work around this problem.
E.g. setObjectProperty("hello", string.getBytes()); -
2. Re: String size limit in ObjectMessage
jeanperrot Jan 7, 2004 12:39 PM (in response to jeanperrot)Thanks for the suggestion -- I should have specified:
JVM 1.4.1, Jboss 3.2.1
The issue has to do with SpyMessage.writeExternal() casting the message property back to String and then writing it out through writeUTF:
if (value instanceof String) {
out.writeByte(STRING);
out.writeUTF((String) value);
}
by specs writeUTF will throw a UTFFormatException if the String is larger than 64kb -- whereas String serialization does work fine (w. 1.4.1 at least).
setObjectProperty("hello", string.getBytes()) will not work as by specs setObjectProperty will not take a byte[] as argument.
I guess I will be using setObject() instead of setObjectProperty() ...