webtier@glassfish.java.net

Error - JSF restore state view

From: <webtier_at_javadesktop.org>
Date: Tue, 09 Jun 2009 10:45:23 PDT

I have an application with JSF 1.1.01 using the reference implementation of the sun (https://javaserverfaces.dev.java.net/ - Mojarra Project) that has the following errors:

2009-05-05 07:35:13,596 ERROR [com.sun.faces.renderkit.ResponseStateManagerImpl] Corrupt GZIP trailer
java.io.IOException: Corrupt GZIP trailer
        at java.util.zip.GZIPInputStream.readTrailer(GZIPInputStream.java:182)
        at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:94)

2009-05-05 07:38:31,151 ERROR [com.sun.faces.renderkit.ResponseStateManagerImpl] invalid type code: 65
java.io.StreamCorruptedException: invalid type code: 65
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1356)
        at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)

2009-05-05 08:48:14,532 ERROR [com.sun.faces.renderkit.ResponseStateManagerImpl] invalid bit length repeat
java.util.zip.ZipException: invalid bit length repeat
        at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:147)
        at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:92)

2009-05-05 09:01:40,003 ERROR [com.sun.faces.renderkit.ResponseStateManagerImpl] invalid literal/lengths set
java.util.zip.ZipException: invalid literal/lengths set
        at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:147)
        at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:92)
                
All these errors are from the method getTreeStructureToRestore class ResponseStateManagerImpl's own implementation of JSF.

Because these errors occur randomly did some tests with the source of the JSF and see that it happens because the parameter of the request "com.sun.faces.VIEW" come truncated.
The number of characters that the server sends to the client (the "com.sun.faces.VIEW") on pages where the error occurs is approximately 12000 characters.
In return the client to the server the string is truncated to 4000 characters about what causes the errors above in an attempt to restore the view state.
        
The method used to save the state of the client view is:
<context-param>
  <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
  <param-value>client</param-value>
</context-param>

Talvez o erro esteja relacionado com o bug citado no link abaixo, porém não é possível simular o problema.
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4188883

[b]Invalid solutions to the problem:[/b]

        Migrate to JSF 1.2

        <context-param>
                <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
                <param-value>server</param-value>
        </context-param>

        <context-param>
                <param-name>com.sun.faces.COMPRESS_STATE</param-name>
                <param-value>false</param-value>
        </context-param>

thanks,
[Message sent by forum member 'fabriciogiordani' (fabriciogiordani)]

http://forums.java.net/jive/thread.jspa?messageID=350097