[jboss-user] [JBossCache] - Re: [TreeCacheMarshaller140] Unknown Magic Number 49

manik.surtani@jboss.com do-not-reply at jboss.com
Wed Aug 30 08:22:07 EDT 2006


Bela, looks like a JBC problem.  

Strings are written to the stream using the marshaller using ObjectOutputStream.writeUTF() - which has this limitation:

http://java.sun.com/j2se/1.5.0/docs/api/java/io/DataOutput.html#writeUTF(java.lang.String)

According to the documentation, this limits string lengths to 65535 bytes.  

Carl, are you using multi-byte Strings (accents, etc)?  32767 characters x 2 bytes per char = 65534 bytes.  32768 characters (at 2 bytes per char) will cross this limit and you will see an overflow.

The fix to this problem would be NOT to use writeUTF() but to serialize the Strings themselves onto the stream, but this is less efficient.



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3968349#3968349

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3968349



More information about the jboss-user mailing list