4 Replies Latest reply on Mar 17, 2012 7:36 PM by Momo Merle

    RichFaces 3.3.3.Final not parsing on Glassfish v3

    mark lewis Newbie

      Hello

       

      I have followed the instructions posted on using RF 3.3.3.Final with a Glassfish 3 setup bearing mind the need to use facelets 1.1.15 etc.

       

      I've read other posts about index.xhtml etc not parsing and I'm having the same problem but none of the suggestions have worked for me.

       

      My pertinent setup is as follows:

       

      • Glassfish v3 installed on my Windows PC ie. JEE 6, JSF 2 with version of facelets which we can't use yet
      • Eclipse 3.6 running ant builds
      • My app lib has richfaces-[api,impl-jsf2,ui].3.3.3.Final jars and jsf-facelets.jar (v1.1.15)
      • My web.xml has these entries:

       

      <web-app version="2.5" xmlns="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">
      
      <!-- FACELETS SETUP -->
          <servlet>
              <servlet-name>Faces Servlet</servlet-name>
              <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
              <load-on-startup>1</load-on-startup>
          </servlet>
      
          <servlet-mapping>
              <servlet-name>Faces Servlet</servlet-name>
              <url-pattern>*.jsf</url-pattern>
          </servlet-mapping>
      
          <context-param>
              <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
              <param-value>.xhtml</param-value>
          </context-param>
          
          <!-- To prevent the error below -->
          <!-- WARNING: facelets.RECREATE_VALUE_EXPRESSION_ON_BUILD_BEFORE_RESTORE 
              is set to 'true' but facelets.BUILD_BEFORE_RESTORE is set to 'false' or unset. 
              To use facelets.RECREATE_VALUE_EXPRESSION_ON_BUILD_BEFORE_RESTORE you must 
              also \ -->
          <!-- set facelets.BUILD_BEFORE_RESTORE to 'true'! -->
          <context-param>
              <param-name>facelets.RECREATE_VALUE_EXPRESSION_ON_BUILD_BEFORE_RESTORE</param-name>
              <param-value>true</param-value>
          </context-param>
      
          <context-param>
              <param-name>javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER</param-name>
              <param-value>true</param-value>
          </context-param>
      
          <context-param>
              <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
              <param-value>com.sun.facelets.FaceletViewHandler</param-value>
          </context-param>
      
      
      
          <!-- RICHFACES SETUP -->
          <context-param>
              <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
              <param-value>server</param-value>
          </context-param>
      
          <context-param>
              <param-name>org.richfaces.SKIN</param-name>
              <param-value>glassX</param-value>
          </context-param>
      
          <context-param>
              <param-name>org.richfaces.CONTROL_SKINNING</param-name>
              <param-value>enable</param-value>
          </context-param>
      
          <context-param>
              <param-name>org.richfaces.CONTROL_SKINNING_CLASSES</param-name>
              <param-value>enable</param-value>
          </context-param>
      
          <context-param>
              <param-name>org.richfaces.LoadStyleStrategy</param-name>
              <param-value>ALL</param-value>
          </context-param>
      
          <!-- must be the first filter in this file! -->
          <filter>
              <display-name>RichFaces Filter</display-name>
              <filter-name>richfaces</filter-name>
              <filter-class>org.ajax4jsf.Filter</filter-class>
          </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>
      
      
      
          <!-- JSF SETUP -->
          <error-page>
              <exception-type>java.lang.Throwable</exception-type>
              <location>/error.html</location>
          </error-page>
      
          <!-- Optional JSF-RI Parameters to Help Debug -->
          <context-param>
              <param-name>com.sun.faces.validateXml</param-name>
              <param-value>true</param-value>
          </context-param>
      

       

      • My faces-config.xml has only managed bean descriptors and this header:

       

      <faces-config version="2.0" xmlns="http://java.sun.com/xml/ns/javaee"
          xmlns:xi="http://www.w3.org/2001/XInclude" 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-facesconfig_2_0.xsd">

       

      • My sun-web.xml has this content

       

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd">
      <sun-web-app error-url="">
        <context-root>/Client</context-root>
        <class-loader delegate="true"/>
        <jsp-config>
          <property name="keepgenerated" value="true">
            <description>Keep a copy of the generated servlet class java code.</description>
          </property>
        </jsp-config>
      </sun-web-app>

       

      The ant build assembles the .war and deploys to GF3 no problem.  With the

      org.ajax4jsf.VIEW_HANDLERS

      entry in web.xml, I get a stack trace 'Error Rendering View[/index.xhtml]' with an Null pointer exception.  If I remove this context-param the app loads into the view but the content is not parsed properly.

       

      Can anyone suggest what I need to tweak to get the pages read?  I feel I'm close to it working but obviously don't know enough to get it working.

        • 1. Re: RichFaces 3.3.3.Final not parsing on Glassfish v3
          mark lewis Newbie

          I added the following to the web.xml:

           


              <context-param>
                  <param-name>javax.faces.FACELETS_LIBRARIES</param-name>
                  <param-value>lib/jsf-facelets.jar;</param-value>
              </context-param>

           

          but this directive appears to have been ignored.

          • 2. Re: RichFaces 3.3.3.Final not parsing on Glassfish v3
            Ilya Shaikovsky Master

            The ant build assembles the .war and deploys to GF3 no problem.  With the
            org.ajax4jsf.VIEW_HANDLERS

             

            entry in web.xml, I get a stack trace 'Error Rendering View[/index.xhtml]' with an Null pointer exception.

            attach complete stacktrace please.

             

            B.t.w. also please try to define facelets view handler  not in web.xml but in faces-config.

            • 3. Re: RichFaces 3.3.3.Final not parsing on Glassfish v3
              Momo Merle Newbie

              Hello. I have got the same problem with RichFaces 3.3.3  not parsing on glassfish v3.1.1. below the server log

               

               

              TTENTION: Aucun RenderingContext disponible

              ATTENTION: StandardWrapperValve[Faces Servlet]: PWC1406: Servlet.service() for servlet Faces Servlet threw exception

              java.lang.NullPointerException

                        at com.sun.faces.context.flash.ELFlash.loggingGetPhaseMapForReading(ELFlash.java:793)

                        at com.sun.faces.context.flash.ELFlash.getPhaseMapForReading(ELFlash.java:826)

                        at com.sun.faces.context.flash.ELFlash.isEmpty(ELFlash.java:484)

                        at com.sun.faces.facelets.util.DevTools.writeVariables(DevTools.java:325)

                        at com.sun.faces.facelets.util.DevTools.writeVariables(DevTools.java:215)

                        at com.sun.faces.facelets.util.DevTools.debugHtml(DevTools.java:130)

                        at com.sun.faces.renderkit.RenderKitUtils.renderHtmlErrorPage(RenderKitUtils.java:1159)

                        at com.sun.faces.context.ExceptionHandlerImpl.throwIt(ExceptionHandlerImpl.java:269)

                        at com.sun.faces.context.ExceptionHandlerImpl.handle(ExceptionHandlerImpl.java:141)

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

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

                        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)

                        at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)

                        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)

                        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)

                        at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)

                        at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)

                        at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)

                        at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)

                        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)

                        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)

                        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)

                        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)

                        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)

                        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)

                        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)

                        at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)

                        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)

                        at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)

                        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)

                        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)

                        at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)

                        at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)

                        at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)

                        at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)

                        at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)

                        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)

                        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)

                        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)

                        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)

                        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)

                        at com.sun.grizzly.ContextTask.run(ContextTask.java:71)

                        at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)

                        at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)

                        at java.lang.Thread.run(Thread.java:662)

               

               

              Can you help me? please

              • 4. Re: RichFaces 3.3.3.Final not parsing on Glassfish v3
                Momo Merle Newbie

                my web.xml is below

                 

                <?xml version="1.0" encoding="UTF-8"?>

                <web-app id="TousEditeurs" version="3.0"

                         xmlns="http://java.sun.com/xml/ns/javaee"

                         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                         xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"

                         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">

                       

                    <display-name>JSF Simple</display-name>

                    <description>Simple demo project with JavaEE 6</description>

                   

                    <welcome-file-list>

                        <welcome-file>default.htm</welcome-file>

                    </welcome-file-list>

                   

                    <!-- JSF -->

                    <servlet>

                        <servlet-name>Faces Servlet</servlet-name>

                        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

                        <load-on-startup>1</load-on-startup>

                    </servlet>

                    <servlet-mapping>

                        <servlet-name>Faces Servlet</servlet-name>

                        <url-pattern>*.xhtml</url-pattern>

                    </servlet-mapping>

                 

                 

                    <context-param>

                        <param-name>javax.faces.PROJECT_STAGE</param-name>

                        <param-value>Development</param-value>

                        <!--

                        <param-value>Production</param-value>

                        -->

                    </context-param>

                        <context-param>

                        <param-name>javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE</param-name>

                        <param-value>true</param-value>

                    </context-param>

                    <!-- /JSF -->

                 

                 

                    <!-- Primefaces -->

                    <context-param>

                        <param-name>primefaces.THEME</param-name>

                        <param-value>smoothness</param-value>

                    </context-param>

                    <!-- /Primefaces -->

                   

                    <filter>

                        <filter-name>Extensions Filter</filter-name>

                        <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>

                    </filter>

                    <filter-mapping>

                        <filter-name>Extensions Filter</filter-name>

                        <servlet-name>Faces Servlet</servlet-name>

                    </filter-mapping>

                   

                <filter>

                    <filter-name>MyFacesExtensionsFilter</filter-name>

                    <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>

                </filter>

                 

                 

                <filter>

                    <filter-name>trinidad</filter-name>

                    <filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-class>

                </filter>

                <filter-mapping>

                    <filter-name>MyFacesExtensionsFilter</filter-name>

                    <servlet-name>Faces Servlet</servlet-name>

                </filter-mapping>

                 

                 

                 

                 

                 

                  <servlet>

                  <servlet-name>resources</servlet-name>

                  <servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet</servlet-class>

                </servlet>

                 

                 

                <!-- This cannot be configured currently -->

                <servlet-mapping>

                    <servlet-name>resources</servlet-name>

                    <url-pattern>/adf/*</url-pattern>

                </servlet-mapping>

                 

                 

                 

                 

                 

                 

                <!-- This cannot be configured currently -->

                <servlet-mapping>

                    <servlet-name>resources</servlet-name>

                    <url-pattern>/adf/*</url-pattern>

                </servlet-mapping>

                 

                 

                 

                 

                 

                 

                <filter>

                                    <display-name>RichFaces Filter</display-name>

                                    <filter-name>richfaces</filter-name>

                                    <filter-class>org.ajax4jsf.Filter</filter-class>

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

                       

                       

                 

                 

                 

                 

                 

                 

                    <context-param>

                                <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>

                                <param-value>com.sun.facelets.FaceletViewHandler</param-value>

                    </context-param>

                 

                 

                <!-- Defining and mapping the RichFaces filter -->

                 

                 

                 

                 

                  <context-param>

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

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

                   </context-param>

                  

                   <!-- Making the RichFaces skin spread to standard HTML controls -->

                   <context-param>

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

                      <param-value>enable</param-value>

                   </context-param>

                 

                 

                 

                 

                 

                  <context-param> <param-name>oracle.adf.view.faces.CHECK_FILE_MODIFICATION</param-name>

                <param-value>false</param-value>

                </context-param>

                 

                 

                 

                 

                <context-param>

                     <param-name>javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER</param-name>

                     <param-value>true</param-value>

                </context-param>

                 

                 

                 

                 

                <listener>

                 

                <listener-class>com.sun.faces.config.ConfigureListener</listener-class>

                 

                </listener>

                 

                </web-app>

                 

                 

                 

                 

                 

                 

                my faces-config :

                 

                 

                 

                <?xml version='1.0' encoding='UTF-8'?>

                <faces-config xmlns="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-facesconfig_2_0.xsd"

                        version="2.0">

                <application>

                    <default-render-kit-id>

                      org.apache.myfaces.trinidad.core

                    </default-render-kit-id>

                  </application>

                <application>     <view-handler>org.ajax4jsf.application.AjaxViewHandler</view-handler></application>

                </faces-config>