Javax.faces.FacesException: Error decoding resource data when loading JSF page

I get the error below when loading a JSF page. The page loads successfully, and the desired operation on the page also performs, but this error appears.

The jsf page contains tab bars and an error appears on clicking each tab. I also found that if I save a certain part of my page as rendered = false, then the error does not occur, but the part is not reloaded again.

I am using JSF2.0 with JSP. and RF3.3

ERROR [[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:371) 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:508) 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.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190) 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:601) 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) ... 25 more 

A snippet of the page code and the jsf component, which when rendering = false in the bean does not throw the above error.

 <rich:tab ignoreDupResponses="true" id="tabModify" style="overflow:auto" styleClass="richTab" label="#{}" eventsQueue="queueForTab" actionListener="#{}"> <rich:layout> <rich:layoutPanel position="right" id="pnlmodfy"> <h:form id="frmModify"> <h:panelGrid> <h:outputLabel value="#{} * :" escape="false" styleClass="intro" /> <h:outputText value=" : " styleClass="intro" /> <rich:comboBox id="Mdfy" value="#{Bean.str}" suggestionValues="#{Bean.arraylist}"> <a4j:support id="id" actionListener="#{Bean.actionListener}" ajaxSingle="true" event="onchange" reRender="modify"> </a4j:support> </rich:comboBox> </h:panelGrid> <a4j:outputPanel id="modify" ajaxRendered="true"> <h:panelGrid columns="3" id="modify"> <h:outputText value="Description *" styleClass="intro"/> <h:outputText value=" : " styleClass="intro" /> <h:inputTextarea id="Desc" required="true" styleClass="textBox" label="Description" value="#{Bean.strDesc}"> </h:inputTextarea> 

If the outputPanel is bound to bean support for rendering, and the intro voltage value is set to false, an error does not occur. However, when retransmitting the outputPanel, the outputPanel never appears.

Basically, there is a problem with the inclusion of the component. I have 4 tabs per page. On two tabs, I use listshuttle (2 components on each tab). On both tabs, the source and target arraialist tied to the listshuttle are the same.

This is because I bind the same list to both shuttles. However, the same code on another tab works perfectly fine ....

ListShuttle Code: -

 <h:outputText value="Select" styleClass="intro" rendered="#{!empty Bean.lstAvailable}"/> <h:outputText value=" : " styleClass="intro" /> <rich:listShuttle id="listShuttleN" sourceValue="#{Bean.lstAvailable}" targetValue="#{KPIManagement.lstSelected}" var="items" listsHeight="100" sourceListWidth="100" targetListWidth="100" sourceCaptionLabel="Available" targetCaptionLabel="Selected" rendered="#{!empty Bean.lstAvailable}"> <rich:column> <h:outputLabel value="#{items}"></h:outputLabel> </rich:column> </rich:listShuttle> 

ArrayList Code: -

 ArrayList<String> lstAvailable=new ArrayList<String>(); 

Inside some function

 lstAvailable=class.function(Some variable)) this.setLstAvailable(lstAvailable); 

The possible answer for this post as observable is that I am encountering some browser issues.

When the same application is accessed from another computer, there is absolutely no exception ... This is strange since I use Firefox 11.0, and there is Firefox 4.0 on the other machine

Perhaps this is really a problem with the browser.

+8
jsf-2 jboss richfaces
source share
3 answers

The problem is that what is happening now is very noticeable in all versions of Firefox> 10.0. There are some changes in the Firefox script that prevent the tree from reading correctly.

Please add the following to your project to resolve all problems associated with the Firefox browser: -

 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 } } 

And also record this filter in the web.xml file.

 <filter> <filter-name>RichFacesFirefox11Filter</filter-name> <filter-class>Packagename.RichFacesFirefox11Filter</filter-class> </filter> <filter-mapping> <filter-name>RichFacesFirefox11Filter</filter-name> <url-pattern>/a4j/*</url-pattern> </filter-mapping> 

This will certainly fix all your problems with Firefox Browsers and RichFaces components.

+13
source share

I have no doubt that AnglesAndDemons answer is correct, but for some reason I could not get it to work. I am using Richfaces 3.3.3 Final, and what worked was downloading the corrected richfaces-impl.jar from the JIRA problem https://issues.jboss.org/browse/RF-12062

+1
source share

Firstly, the <rich:tabPanel> , which wraps each <rich:tab> , must be inside the form (note the note in the documentation) so the form inside the tab is optional. In addition, if you want to trigger a server action when you click on any tab, you must verify that switchType with a server value.

One more thing, maybe your XHTML code inside <a4j:outputPanel> contains errors, it would be better if you updated your post with full or a lot of this code.

0
source share

All Articles