Java IO Tutorial

PrimeFaces : java.io.IOException: Not in GZIP format

Recently, testing on PrimeFaces’ idleMonitor component.


<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<h:head>
</h:head>
<h:body>
  <h1>PrimeFaces and idleMonitor</h1>

    <p:growl id="messages" showDetail="true" sticky="true" />

    <p:idleMonitor timeout="10000" update="messages">
	<p:ajax event="idle" listener="#{idleBean.idleListener}" update="messages" />
    </p:idleMonitor>
		
</h:body>
</html>

Problem

After 10 seconds, console prompts java.io.IOException: Not in GZIP format? That’s weird, what GZIP to do iwith idleMonitor component?


INFO: Server startup in 4279 ms
Aug 8, 2012 2:42:48 PM com.sun.faces.renderkit.ClientSideStateHelper doGetState
SEVERE: Not in GZIP format
java.io.IOException: Not in GZIP format
	at java.util.zip.GZIPInputStream.readHeader(GZIPInputStream.java:141)
	at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:56)
	at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:65)

Solution

To fix it, just wrap all PrimeFaces components with form tag. No idea why, but it solved the problem.


<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<h:head>
</h:head>
<h:body>
<h1>PrimeFaces and idleMonitor</h1>

  <h:form>
	
    <p:growl id="messages" showDetail="true" sticky="true" />

    <p:idleMonitor timeout="10000" update="messages">
	<p:ajax event="idle" listener="#{idleBean.idleListener}" update="messages" />
    </p:idleMonitor>
		
  </h:form>
	
</h:body>
</html>

References

  1. PrimeFaces idleMonitor showcase

About Author

author image
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

Subscribe
Notify of
1 Comment
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
Jose Luis
11 years ago

Hi, i get the same error but, with the dataTable component. When i try to do the pagination throw the error. I already try to fix it with the form tag but it doesnt work, i still get the error.

Caused by: java.io.IOException: Not in GZIP format
	at java.util.zip.GZIPInputStream.readHeader(GZIPInputStream.java:141)
	at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:56)
	at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:65)
	at com.sun.faces.renderkit.ClientSideStateHelper.doGetState(ClientSideStateHelper.java:231)