9 Replies Latest reply on Aug 16, 2012 5:14 AM by Sanjeev Shrestha

    rich:dataTable doesn't work after migration to RF4

    Sergey Morenets Novice

      Hi

       

      I'm in the process of the migration from RF 3.3.3 to RF4. One of the weird issues is that data iteration components

      stopped working. The following table worked fine in 3.3.3 but produces no HTML in 4.2.2.

      adminBean.products is not empty and adminBean.products.size() outputs 77 on the same page.

      Help is appreciated!

       

      <rich:dataTable value="#{adminBean.products}" id="products"
      var="product" width="100%" rows="15"
      >
      <rich:column>
      <h:outputText value="#{product.name}" />
      </rich:column>
      </rich:dataTable>
        • 1. Re: rich:dataTable doesn't work after migration to RF4
          Sanjeev Shrestha Novice

          There must be something wrong with your tag library. Have you checked if you have rendered correctly. Which server are you using. Please post your web.xml. In the mean time this is one of the examples I tried, Hope this helps you. and please have a look at the response from firebug.

          • 2. Re: rich:dataTable doesn't work after migration to RF4
            Sergey Morenets Novice

            Sanjeev, thank you for the hint.

            Your sample is rather straightforward. I also use Spring rather intensively. I've already downloaded and installed showcase example.

            My guess is that something is wrong with my configuration. Please see below my web.xml

             

            <?xml version="1.0" encoding="ISO-8859-1"?>

            <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/j2ee"

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

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

                <description>Web-based system</description>

                <display-name>Management system</display-name>

                <context-param>

                    <param-name>com.sun.faces.expressionFactory</param-name>

                    <param-value>org.jboss.el.ExpressionFactoryImpl</param-value>

                </context-param>

                <context-param>

                    <param-name>contextConfigLocation</param-name>

                    <param-value>/WEB-INF/main-service.xml

                        </param-value>

                </context-param>

                <context-param>

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

                    <param-value>.xhtml</param-value>

                </context-param>

                <context-param>

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

                    <param-value>server</param-value>

                </context-param>

            <context-param>

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

                    <param-value>1</param-value>

                </context-param>

                <!-- - Location of the Log4J config file, for initialization and refresh

                    checks. - Applied by Log4jConfigListener. -->

                <context-param>

                    <param-name>log4jConfigLocation</param-name>

                    <param-value>/WEB-INF/log4j.properties</param-value>

                </context-param>

                <context-param>

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

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

                </context-param>

                <context-param>

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

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

                </context-param>

                <context-param>

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

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

                </context-param>

                <!-- - Key of the system property that should specify the root directory

                    of this - web app. Applied by WebAppRootListener or Log4jConfigListener. -->

                <context-param>

                    <param-name>webAppRootKey</param-name>

                    <param-value>main.root</param-value>

                </context-param>   

                <filter>

                    <filter-name>hibernateFilter</filter-name>

                    <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>

                </filter>   

                <filter>

                    <filter-name>charEncodingFilter</filter-name>

                    <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>

                    <init-param>

                        <param-name>encoding</param-name>

                        <param-value>UTF-8</param-value>

                    </init-param>

                    <init-param>

                        <param-name>forceEncoding</param-name>

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

                    </init-param>

                </filter>

                <filter>

                    <filter-name>springSecurityFilterChain</filter-name>

                    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>

                </filter>

                <filter>

                    <filter-name>UrlRewriteFilter</filter-name>

                    <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>

                </filter>

                <filter-mapping>

                    <filter-name>charEncodingFilter</filter-name>

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

                </filter-mapping>

                <filter-mapping>

                    <filter-name>springSecurityFilterChain</filter-name>

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

                </filter-mapping>

                <filter-mapping>

                    <filter-name>hibernateFilter</filter-name>

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

                </filter-mapping>

                <filter-mapping>

                    <filter-name>UrlRewriteFilter</filter-name>

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

                </filter-mapping>

                <listener>

                    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>

                </listener>

                <listener>

                    <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>

                </listener>

                <listener>

                    <listener-class>org.springframework.security.web.session.HttpSessionEventPublisher</listener-class>

                </listener>

                <!-- Serves static resource content from .jar files such as spring-faces.jar -->

                <servlet>

                    <servlet-name>Resources Servlet</servlet-name>

                    <servlet-class>org.springframework.js.resource.ResourceServlet</servlet-class>

                    <load-on-startup>0</load-on-startup>

                </servlet>

                <servlet>

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

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

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

                </servlet>

            <servlet>

              <servlet-name>Dispatcher Servlet</servlet-name>

              <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>

              <init-param>

               <param-name>contextConfigLocation</param-name>

               <param-value/>

              </init-param>

              <load-on-startup>2</load-on-startup>

            </servlet>

                <servlet-mapping>

                    <servlet-name>Resources Servlet</servlet-name>

                    <url-pattern>/resources/*</url-pattern>

                </servlet-mapping>

                <servlet-mapping>

                    <servlet-name>Dispatcher Servlet</servlet-name>

                    <url-pattern>/site/*</url-pattern>

                </servlet-mapping>

                <!-- Faces Servlet Mapping -->

                <servlet-mapping>

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

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

                </servlet-mapping>

                <welcome-file-list>

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

                </welcome-file-list>

            </web-app>

            • 3. Re: rich:dataTable doesn't work after migration to RF4
              Sanjeev Shrestha Novice

              Firstly upgrade your web.xml servlet version

               

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

              <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" 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" id="WebApp_ID" version="3.0">

               

              This is deprecated

              <context-param>

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

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

                  </context-param>

                  <context-param>

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

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

                  </context-param>

               

              It is used as

               

              <context-param>

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

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

                  </context-param>

                  <context-param>

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

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

                  </context-param>

               

              Look at this for details

              https://community.jboss.org/wiki/RichFacesMigrationGuide33x-4xMigration

               

              https://community.jboss.org/wiki/RichFacesMigrationGuide33x-4xMigration-Upgrading

               

              Please install firebug and look for the place where the datatable should load. This will give you an idea. Set the rendered attribute as true.

               

              Please try to render a rich:panel or anything associated to richfaces and see if it works. and view the source of the document to see if the document has been processed by jsf.

               

              I haven't used spring so I don't really know about it but here is an article as suggested by Brendan,

              http://www.mkyong.com/jsf2/jsf-2-0-spring-integration-example/

               

              Hope this resolves your problem.

              1 of 1 people found this helpful
              • 4. Re: rich:dataTable doesn't work after migration to RF4
                Sergey Morenets Novice

                Thanks a lot, Sanjeev.

                 

                This is rather helpful tutorial. I reviewed few additional working samples and step-by-step made my application starting and working.

                Unfortunately there're a lot incompatible changes between 3.3.3 and 4.x so I need to think out the migration plans.

                 

                I also noticed weird exception after I had integrated Spring Web Flow to my project. Have you ever encountered something similar ?

                 

                ERROR FlowExecutionImpl : FlowExecutionListener threw exception

                java.lang.NullPointerException

                    at org.springframework.faces.webflow.FlowFacesContextLifecycleListener.requestProcessed(FlowFacesContextLifecycleListener.java:45)

                    at org.springframework.webflow.engine.impl.FlowExecutionListeners.fireRequestProcessed(FlowExecutionListeners.java:98)

                    at org.springframework.webflow.engine.impl.FlowExecutionImpl.start(FlowExecutionImpl.java:237)

                    at org.springframework.webflow.executor.FlowExecutorImpl.launchExecution(FlowExecutorImpl.java:140)

                    at org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:193)

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

                    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:621)

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

                • 5. Re: rich:dataTable doesn't work after migration to RF4
                  Sanjeev Shrestha Novice

                  Sorry I have very limited knowlegde about it. But I think you should have a look at JSF 2 The complete reference. There you will find a section where it says how spring is used with JSF 2 and which part of lifecycle it is invoked. Maybe it maybe due to the web.xml file. Try using only minimal configurations for a while. Just try running a simple piece of code.See if that works. Hope you work it out.

                   

                  By the looks of the stacktrace there is something wrong with the configuration in web.xml for spring webflow.

                  • 6. Re: rich:dataTable doesn't work after migration to RF4
                    Sergey Morenets Novice

                    Yes, I'm aware about JSF2, The complete reference. However there is no single word about Spring/Spring Web Flow integration there.

                    I guess it is not very common and thus non-trivial. Unfortunately SWF forums also don't give much information about the exception.

                    • 7. Re: rich:dataTable doesn't work after migration to RF4
                      Sanjeev Shrestha Novice

                      Have you looked at this article.

                       

                      https://community.jboss.org/thread/203886?tstart=0

                       

                      He is also trying to use webflow. Maybe he can help you.

                      • 8. Re: rich:dataTable doesn't work after migration to RF4
                        Sergey Morenets Novice

                        Thank you, Sanjeev.

                         

                        You know the sample referenced in the post was rather useful. I mean booking example with JSF and RF integration. Although it didn't resolve my issue(with exception) I got a big piece of information related to the integration.

                        Regarding the original issue - it was resolved so application works fine now.

                        Thank you for all your efforts.

                        • 9. Re: rich:dataTable doesn't work after migration to RF4
                          Sanjeev Shrestha Novice

                          That is nice to hear. Good to know that you resolved it.