3 Replies Latest reply on Dec 23, 2008 12:11 PM by Anton Lisovenko

    RichFaces and Facelets integration

    Anton Lisovenko Newbie

      I tried to integrate Facelets to the existing RichFaces + JSF RI + Tomahawk project, but faced some problems. What I did:

      1. Added facelets view handler to faces-config.xml

      <application>
       <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>...
      </application>

      2. Changed .jsp to .xhtml for files
      3. Changed <@%taglib...> directives to <html xmlns...>:

      I tried to load simple login.xhtml, the page loaded and all <h:input> tags were rendered correctly, but <rich:..> tags were not rendered correctly(e.g. <rich:spacer height="300"/> resulted in also "<rich:spacer height="300"/>" on html page and it was ignored by browser). It seems, that AjaxViewHandler was not used during parsing tags. I know, that a lot of people use Facelets with Jsf and Richfaces, so it shouldn't be difficult to find the reason.

      Thanks in advance!

        • 1. Re: RichFaces and Facelets integration
          Ilya Shaikovsky Master

          our richfaces demo built on top of the JSF and facelets. please check carefully RF components namespaces.

          • 2. Re: RichFaces and Facelets integration
            Anton Lisovenko Newbie

            I found the reason, richfaces.taglib.xml and ajax4j.taglib.xml were not loaded correctly by facelets, here is the stack:

            SEVERE: Error Loading Library: jar:file:/C:/apache-tomcat-6.0.18/lib/richfaces-ui-3.2.2.SR1.jar!/META-INF/a4j.taglib.xml
            java.io.IOException: Error parsing [jar:file:/C:/apache-tomcat-6.0.18/lib/richfaces-ui-3.2.2.SR1.jar!/META-INF/a4j.taglib.xml]:
             at com.sun.facelets.compiler.TagLibraryConfig.create(TagLibraryConfig.java:410)
             ...
            Caused by: org.xml.sax.SAXException: Error Handling [jar:file:/C:/apache-tomcat-6.0.18/lib/richfaces-ui-3.2.2.SR1.jar!/META-INF/a4j.taglib.xml@12,98] <handler-class>
             at com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement(TagLibraryConfig.java:271)
             at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
             at org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope(Unknown Source)
             at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source)
             at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
             at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
             at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
             at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
             at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
             at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
             at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
             at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
             at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
             at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
             at javax.xml.parsers.SAXParser.parse(SAXParser.java:176)
             at com.sun.facelets.compiler.TagLibraryConfig.create(TagLibraryConfig.java:407)
             ... 43 more
            Caused by: java.lang.Exception: org.ajax4jsf.taglib.html.facelets.ActionParamHandler must be an instance of com.sun.facelets.tag.TagHandler
             at com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.createClass(TagLibraryConfig.java:293)
             at com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement(TagLibraryConfig.java:210)
            


            I looked through all libraries, there is no more class with "ActionParamHandler" name except in richfaces-ui-3.2.2.SR1.jar and it extends facelets TagHandler class, but the error stack says the other thing... It's pretty strange..

            • 3. Re: RichFaces and Facelets integration
              Anton Lisovenko Newbie

              The topic is closed, I had facelets library both in web application libraries and in tomcat libraries, this affected the class loading somehow... Childish thing, thx to everyone :)