5 Replies Latest reply on Mar 9, 2009 4:16 AM by Carlos Prieto

    loadStyle throws FacesException caused by DataFormatExceptio

    Carlos Prieto Newbie

      Hello,

      When using <a4j:loadStyle src="resource:///stylesheet/corpme.xcss"/> I'm getting this exception:

      javax.faces.FacesException: Error decode resource data
       at org.ajax4jsf.resource.ResourceBuilderImpl.decrypt(ResourceBuilderImpl.java:618)
       at org.ajax4jsf.resource.ResourceBuilderImpl.getResourceDataForKey(ResourceBuilderImpl.java:360)
       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:510)
       at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
       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:230)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
       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:157)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: java.util.zip.DataFormatException: unknown compression method
       at java.util.zip.Inflater.inflateBytes(Native Method)
       at java.util.zip.Inflater.inflate(Inflater.java:215)
       at java.util.zip.Inflater.inflate(Inflater.java:232)
       at org.ajax4jsf.resource.ResourceBuilderImpl.decrypt(ResourceBuilderImpl.java:612)
       ... 28 more


      corpme.xcss is like this:

      <?xml version="1.0" encoding="UTF-8"?>
      <f:template xmlns:f="http:/jsf.exadel.com/template"
       xmlns:u="http:/jsf.exadel.com/template/util'"
       xmlns="http://www.w3.org/1999/xhtml" >
      
       <f:verbatim><![CDATA[
       body {
       background-color: #0000ff;
       }
       ]]></f:verbatim>
      
       <u:selector name=".myCssClass">
       <u:style name="font-size" skin="generalSizeFont" />
       <u:style name="font-family" skin="generalFamilyFont" />
       <u:style name="color" skin="generalTextColor" />
       </u:selector>
      
      </f:template>


      The generated HTML is like this:

      <link class="user" href="/Visor/a4j/s/3_3_0.GAstylesheet/corpme.xcss/DATB/eAGbUnaFO3T5DGkAEaUDmQ__" rel="stylesheet" type="text/css" />
      


      Is it OK? I'm using Richfaces 3.3.0.GA and deploying the application as an EAR in JBoss 4.2.2.GA. Taking a look at the structure of the deployment folder, the corpme.xcss file is located in deploy/Visor-ear.ear/Visor-app.war/stylesheet/corpme.xcss, and it looks like a4j:loadStyle is finding it because, if I change the path to a non-existing one (<a4j:loadStyle src="resource:///non/existing/path/corpme.xcss" />) the exception thrown is a ResourceNotFoundException.

      What am I doing wrong?

      Thank you in advance.