In digging into the source of ObjectOutputStream, (1.6.0_11) this appears to be the best option anyway - if writeUnshared() is called with a String, it eventually calls a method writeString() that does the UTF length check and calls a special "writeLongUTF()" method on the backing BlockDataOutputStream.
This gets the same performance benefit without the length limitation, or any special handling in the calling code. Just confirming Aaron's fix wouldn't cause any performance hit, or even necessarily the rendered result, except in extreme cases like this where the UTF8 string header in the output stream is 8 bytes instead of 2. ...it turned out to be much simpler for us to replace the calls to objectOutputStream.writeUTF() with calls to objectOutputStream.writeUnshared(). In case anyone else runs into this, the following approach is working well for us. We had to create our own RequestCycleFactoryImpl, RequestCycle and CompressedDataEncoder classes to plumb in the writeUTF -> writeUnshared change. That was done by adding a block to hivemodule.xml to replace the implementation of service-id="tapestry.request.RequestCycleFactory". We were worried about a performance hit with the change but it seems to be at least as fast for us. ... -- View this message in context: http://www.nabble.com/-Tapestry-4.1--UTFDataFormatException-in-RequestCycle.encodeIdState-tp24314990p24990567.html Sent from the Tapestry - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org