0 Replies Latest reply on Jun 19, 2008 3:30 AM by Bart Kummel

    RichFaces + Facelets + MyFaces Trinidad on Glassfish...

    Bart Kummel Newbie

      Hi,

      We have an application that's being deployed to a Glassfish v2 server. It uses myFaces trinidad components (1.2.4) on Facelets (1.1.14) pages. Sinces it's being deployed to Glassfish, I think the JSF implementation in use is Sun's reference implementation (1.2) that comes with Glassfish.

      We're looking into adding some drag-and-drop support. The trinidad components do not have that feature (yet?), so we're interested in using RichFaces / Ajax4Jsf to add drag-and-drop functionality to our existing pages.

      I downloaded RichFaces 3.2.1.GA and followed the instructions for using RichFaces with Facelets. However, I cannot get the application working. I get all sorts of ClassNotFoundExceptions at deploy time. The classes that cannot be found are mostly javax.faces.* or javax.servlet.* classes. I suppose those classes should be on the classpath, since they're all part of the JEE API. I tried copying some JARs to the lib/ext directory of my domain on the Glassfish server. It did change something: everytime I add some JAR, I get a diffetent ClassNotFoundException. But I think copying those JARs is not a good solution. I'm afraid I'll end up copying all of the JavaEE JARs, which is not good.

      Here's my web.xml:

      <?xml version="1.0" encoding="ISO-8859-1"?>
      <web-app
       version="2.5"
       xmlns:javaee="http://java.sun.com/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
       <context-param>
       <param-name>org.apache.myfaces.trinidad.DISABLE_CONTENT_COMPRESSION</param-name>
       <param-value>true</param-value>
       </context-param>
       <context-param>
       <javaee:param-name>org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER</javaee:param-name>
       <javaee:param-value>com.sun.facelets.FaceletViewHandler</javaee:param-value>
       </context-param>
       <context-param>
       <javaee:param-name>javax.faces.DEFAULT_SUFFIX</javaee:param-name>
       <javaee:param-value>.jspx</javaee:param-value>
       </context-param>
       <context-param>
       <javaee:param-name>javax.faces.STATE_SAVING_METHOD</javaee:param-name>
       <javaee:param-value>client</javaee:param-value>
       </context-param>
       <context-param>
       <javaee:param-name>org.apache.myfaces.trinidad.USE_APPLICATION_VIEW_CACHE</javaee:param-name>
       <javaee:param-value>false</javaee:param-value>
       </context-param>
       <context-param>
       <javaee:param-name>org.apache.myfaces.trinidad.CHECK_FILE_MODIFICATION</javaee:param-name>
       <javaee:param-value>true</javaee:param-value>
       </context-param>
       <context-param>
       <javaee:param-name>org.apache.myfaces.trinidad.CHANGE_PERSISTENCE</javaee:param-name>
       <javaee:param-value>session</javaee:param-value>
       </context-param>
       <filter>
       <filter-name>trinidad</filter-name>
       <filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-class>
       </filter>
       <filter-mapping>
       <filter-name>trinidad</filter-name>
       <servlet-name>faces</servlet-name>
       </filter-mapping>
       <servlet>
       <servlet-name>faces</servlet-name>
       <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
       </servlet>
       <servlet>
       <servlet-name>resources</servlet-name>
       <servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet</servlet-class>
       </servlet>
       <servlet-mapping>
       <servlet-name>faces</servlet-name>
       <url-pattern>/faces/*</url-pattern>
       </servlet-mapping>
       <servlet-mapping>
       <servlet-name>resources</servlet-name>
       <url-pattern>/adf/*</url-pattern>
       </servlet-mapping>
       <!-- the next sction registers our own Facelets tag library -->
       <context-param>
       <param-name>facelets.LIBRARIES</param-name>
       <param-value>/WEB-INF/facelets/tags/kpm.taglib.xml</param-value>
       </context-param>
       <context-param>
       <param-name>facelets.SKIP_COMMENTS</param-name>
       <param-value>true</param-value>
       </context-param>
      
       <!-- RichFaces / Ajax4JSF -->
      
       <context-param>
       <param-name>org.richfaces.SKIN</param-name>
       <param-value>blueSky</param-value>
       </context-param>
      
       <!--
       The next context-param is for Facelets support of Ajax4JSF...
       -->
       <context-param>
       <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
       <param-value>com.sun.facelets.FaceletViewHandler</param-value>
       </context-param>
      
      
       <filter>
       <display-name>RichFaces Filter</display-name>
       <filter-name>richfaces</filter-name>
       <filter-class>org.ajax4jsf.Filter</filter-class>
       <!--
       MyFaces Ajaxified components like InputSuggestAjax may
       stop working after Ajax4JSF is configured in the application.
       In order to overcome this forceparser property of the
       Ajax4JSF Filter needs to be disabled.
      
       from http://wiki.apache.org/myfaces/AJAX4JSF_and_MyFaces
       -->
       <init-param>
       <param-name>forceparser</param-name>
       <param-value>false</param-value>
       </init-param>
       </filter>
      
       <filter-mapping>
       <filter-name>richfaces</filter-name>
       <servlet-name>Faces Servlet</servlet-name>
       <dispatcher>REQUEST</dispatcher>
       <dispatcher>FORWARD</dispatcher>
       <dispatcher>INCLUDE</dispatcher>
       </filter-mapping>
      
       <!-- Einde RichFaces / Ajax4JSF -->
      
      </web-app>
      

      I hope someone can help me out...

      Best regards,
      Bart Kummel