title: java.util.zip.DataFormatException: incorrect data check
body: <p>I am getting the below mentioned error while loading the JSF page. The page gets loaded successfully and the desired operation on the page is also done but this error comes.</p>
  
  <p>The JSF page contains tab panels and if I try to include some items from available items to included items, the error comes. Following is the XHTML of the lists.</p>
  
  <pre><code>&lt;a4j:outputPanel id="selectItems"&gt;
      &lt;div id="div_selectItems" class="scroll_container"&gt;
          &lt;s:div styleClass="dialogueAttribute"&gt;
              &lt;rich:listShuttle sourceValue="#{itemReportEditor.itemsList}"
                                targetValue="#{itemReportEntry.itemReportData}"
                                var="items"
                                listsHeight="28em"
                                sourceListWidth="45em"
                                targetListWidth="45em"
                                sourceCaptionLabel="Available Items"
                                targetCaptionLabel="Included Items"
                                removeAllControlLabel="Remove all"
                                removeControlLabel="Remove"
                                copyControlLabel="Add"
                                copyAllControlLabel="Add all"
                                fastOrderControlsVisible="true"
                                orderControlsVisible="true"
                                converter="#{itemReportEditor.itemReportDataModelConverter}"&gt;
                  &lt;rich:column&gt;
                      &lt;f:facet name="header"&gt;
                          &lt;h:outputText title="Performance item name"
                                        value="Name"/&gt;
                      &lt;/f:facet&gt;
                      &lt;h:outputText value="#{items['itemName']}"&gt;&lt;/h:outputText&gt;
                  &lt;/rich:column&gt;
  
                  &lt;rich:column&gt;
                      &lt;f:facet name="header"&gt;
                          &lt;h:outputText title="Performance Item Protocol"
                                        value="Protocol"/&gt;
                      &lt;/f:facet&gt;
                      &lt;h:outputText value="#{items['protocol']}"&gt;&lt;/h:outputText&gt;
                  &lt;/rich:column&gt;
  
                  &lt;a4j:support event="onlistchanged"
                               action="#{itemReportEntry.updateItemsList()}"
                               reRender="la"
                               oncomplete="resizeScrollBox2();"
                               status="workingStatus"
                               eventsQueue="ajaxQueue"/&gt;
              &lt;/rich:listShuttle&gt;
          &lt;/s:div&gt;
      &lt;/div&gt;
  &lt;/a4j:outputPanel&gt;
  </code></pre>
  
  <p>I am trying to add some items using list shuttle from left hand side to right hand side and I am getting the following exception (only in FireFox browser, did not observe this issue in Google Chrome) in logs (able to apply all the changes properly, just getting the following exception). My FireFox version is 35.0.1</p>
  
  <pre><code>2015-04-06 15:42:34,272 ERROR [http-0.0.0.0-8080-8] org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/client].[Faces Servlet]
  Servlet.service() for servlet Faces Servlet threw exception
  
  javax.faces.FacesException: Error decode resource data
      at org.ajax4jsf.resource.ResourceBuilderImpl.decrypt(ResourceBuilderImpl.java:627)
      at org.ajax4jsf.resource.ResourceBuilderImpl.getResourceDataForKey(ResourceBuilderImpl.java:369)
      at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:156)
      at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:141)
      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:488)
      at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
      at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
      at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      at java.lang.Thread.run(Thread.java:662)
  Caused by: java.util.zip.DataFormatException: incorrect data check
      at java.util.zip.Inflater.inflateBytes(Native Method)
      at java.util.zip.Inflater.inflate(Inflater.java:238)
      at java.util.zip.Inflater.inflate(Inflater.java:256)
      at org.ajax4jsf.resource.ResourceBuilderImpl.decrypt(ResourceBuilderImpl.java:621)
      ... 30 more
  </code></pre>
  
  <p>Googling I found "The problem seems to be that characters like '!' are converted by FireFox to '%21'. The following filter will convert the %21 back to '!' so resource can be found in the server"</p>
  
  <p>In my case, I am just getting the exception in logs but all the sources are successfully loaded</p>
  
  <p>In order to eliminate the exception, I added the filter </p>
  
  <pre><code>package juno.sa.server;
  
  import java.io.IOException;
  import java.io.UnsupportedEncodingException;
  import java.net.URLDecoder;
  
  import javax.servlet.Filter;
  import javax.servlet.FilterChain;
  import javax.servlet.FilterConfig;
  import javax.servlet.ServletException;
  import javax.servlet.ServletRequest;
  import javax.servlet.ServletResponse;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletRequestWrapper;
  
  public class RichFacesFirefox11Filter implements Filter {
  
      @Override
      public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
          chain.doFilter(new HttpServletRequestWrapper((HttpServletRequest) request) {
              @Override
              public String getRequestURI() {
                  try {
                      return URLDecoder.decode(super.getRequestURI(), "UTF-8");
                  } catch (UnsupportedEncodingException e) {
  
                      throw new IllegalStateException("Cannot decode request URI.", e);
                  }
              }
          }, response);
      }
  
      @Override
      public void init(FilterConfig filterConfig) throws ServletException {
          // do nothing
      }
  
      @Override
      public void destroy() {
          // do nothing
      }
  }
  </code></pre>
  
  
  
  <pre><code>&lt;filter&gt;
      &lt;filter-name&gt;RichFacesFirefox11Filter&lt;/filter-name&gt;
      &lt;filter-class&gt;juno.sa.server.RichFacesFirefox11Filter&lt;/filter-class&gt;
  &lt;/filter&gt;
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;RichFacesFirefox11Filter&lt;/filter-name&gt;
      &lt;url-pattern&gt;*.seam&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;
  </code></pre>