2 Replies Latest reply on Jul 5, 2011 4:54 AM by Benoit VI

    Richfaces 4 custom skin

    Benoit VI Newbie

      Hi, I notice an error when trying to use a simple custom skin with Richfaces 4.0.0.Final.

       

      I have the following parameters (web.xml):

      <context-param>

        <description>Ma skin</description>

        <param-name>org.richfaces.skin</param-name>

        <param-value>myskin</param-value>

      </context-param>

      <context-param>

        <description>Définit la skin utilisée par RichFaces 4</description>

        <param-name>org.richfaces.baseSkin</param-name>

        <param-value>blueSky</param-value>

      </context-param>

       

      And the following exception occurs :

       

      java.io.FileNotFoundException: /inputBackgroundImage.png.xhtml Not Found in ExternalContext as a Resource

      at com.sun.faces.facelets.impl.DefaultFaceletFactory.resolveURL(DefaultFaceletFactory.java:224)

      at com.sun.faces.facelets.impl.DefaultFaceletFactory.resolveURL(DefaultFaceletFactory.java:265)

      at com.sun.faces.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:193)

      at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:741)

      at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:100)

      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)

      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)

      at org.springframework.faces.mvc.JsfView.renderMergedOutputModel(JsfView.java:85)

      at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)

      at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1047)

      at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:817)

      at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)

      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)

      at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)

       

              

      It appears some richfaces ressources (referenced in skinning_classes.ecss from module richfaces-core-impl) are not found

       

      I tried to find theses images (inputBackgroundImage.png, etc ...) in richfaces 4 sources , but no way.... may someone please help me ?

        • 1. Re: Richfaces 4 custom skin
          Benoit VI Newbie

          These image (inputBackgroundImage.png) seems to be generated by Richfaces 4 (cf org.richfaces.renderkit.html.images.InputBackgroundImage) with a height of -1.

           

          And the exception I observe is :

           

           

           

           

          java.lang.IllegalArgumentException: Width (2000) and height (0) cannot be <= 0
          java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:999)
          java.awt.image.BufferedImage.<init>(BufferedImage.java:321)
          org.richfaces.resource.ImageType.createARGBImage(ImageType.java:103)
          org.richfaces.resource.ImageType.access$200(ImageType.java:34)
          org.richfaces.resource.ImageType$2.createImage(ImageType.java:44)
          org.richfaces.resource.ImageType.createImage(ImageType.java:118)
          org.richfaces.resource.Java2DUserResourceWrapperImpl.paintAndWrite(Java2DUserResourceWrapperImpl.java:155)
          org.richfaces.resource.Java2DUserResourceWrapperImpl.getInputStream(Java2DUserResourceWrapperImpl.java:65)
          org.richfaces.resource.CachedResourceImpl.initialize(CachedResourceImpl.java:178)
          org.richfaces.resource.ResourceHandlerImpl.handleResourceRequest(ResourceHandlerImpl.java:171)

           

           

          Can you help please ?

          • 2. Re: Richfaces 4 custom skin
            Benoit VI Newbie

            Finally I have found the apparent cause :

             

            Richfaces 4 does not support the use of "em" inside skin properties (cf org.richfaces.renderkit.util.HtmlDimensions) , and my xxx.skin.properties file contained some, for instance :

             

            generalSizeFont=1em

            ....

             

            My workaround is to define these properties in "px", and the exception no more occurs.