3 Replies Latest reply on Feb 5, 2008 5:42 PM by gjeudy

    Multiple random rendering of facelet components

    gjeudy

      Hi,

      I am upgrading a seam1.2 JSF1.1 application to seam2.0 JSF1.2.

      Now that I finished upgrading and deployed the upgraded app to the server, I display the same facelet page that used to work before, now it displays randomly several times the same components (several forms, buttons etc in random order).

      I followed scrutinously guidelines to migrate to seam 2.0 JSF1.2. I'm running in JBoss 4.2.2.

      All facelet(*.xhtml) pages are exhibiting the same behavior except for pages with no forms or buttons.

      Can anybody give hints of what could be wrong ? I will gladly supply all required information to troubleshoot this issue.

      Thanks,
      -Guillaume

        • 1. Re: Multiple random rendering of facelet components
          gjeudy

          I figured its a s:decorate tag causing the funky behavior. I removed the s:decorate tags, even though I don't know what could be causing the issue.

          Now the page is rendering normally except that nothing happens when I click a button on the page. The same page gets rerendered even though it should get to the stateful bean execution.

          Prior to seam2.0/JSF1.2 upgrade this exact same button click used to bind to a stateful bean method execution which did some processing and returned a different view id.

          Has anyone experienced something similar ?

          • 2. Re: Multiple random rendering of facelet components
            gjeudy

            No outstanding exception happens on the server side. The seam phase listener processes the request and renders the same page as the response without getting to my stateful ejb method execution. See page below:

            #{packageEditAction.selectReleasePackage} should resolve to my stateful bean method execution (none of the code has changed between the upgrade from seam 1.2.1 to seam 2.0.

            Any help would be greatly appreciated,
            Thanks,
            -Guillaume


            <ui:composition xmlns="http://www.w3.org/1999/xhtml"
             xmlns:ui="http://java.sun.com/jsf/facelets"
             xmlns:f="http://java.sun.com/jsf/core"
             xmlns:h="http://java.sun.com/jsf/html"
             xmlns:s="http://jboss.com/products/seam/taglib" template="template.xhtml">
            
             <ui:define name="body">
            
             <script type="text/javascript" src="rdm.js"></script>
             <h:messages />
            
             <h:form id="packageForm">
             <fieldset>
             <table border="1">
             <tr>
             <td width="100%" colspan="3" align="center">
             <h4>Release Packages</h4>
             </td>
             </tr>
             <tr>
             <td width="50%"><b>Select a Release Package: </b>
             </td>
             </tr>
             <tr>
             <td width="50%"><h:selectOneListbox
             id="existrel" value="#{relPkg}" required="false" size="20">
             <s:selectItems value="#{releasePackagesResult}" var="relPkg"
             label="#{relPkg.releasePackageId}--#{relPkg.releasePackageNm}" />
             <s:convertEntity />
             </h:selectOneListbox></td>
             </tr>
             </table>
             <h:commandButton value="Manage Release Package Items"
             action="#{packageEditAction.selectReleasePackage}" />
             </fieldset>
             </h:form>
             </ui:define>
            </ui:composition>


            • 3. Re: Multiple random rendering of facelet components
              gjeudy

              I added a new s:button with the same #{packageEditAction.selectReleasePackage} side by side on the same page and it executes normally (well at least I get to the intended view (I have other types of errors but it is not in the interest of this thread)

              I believe there is something seriously wrong with my setup. I can't conceive this would be bugs in seam2.0.

              see my config, the web.xml:

              <?xml version="1.0" encoding="UTF-8"?>
              <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">
              
              
               <!-- Seam -->
               <listener>
               <listener-class>
               org.jboss.seam.servlet.SeamListener
               </listener-class>
               </listener>
              
               <servlet>
               <servlet-name>Seam Resource Servlet</servlet-name>
               <servlet-class>
               org.jboss.seam.servlet.ResourceServlet
               </servlet-class>
               </servlet>
              
               <servlet-mapping>
               <servlet-name>Seam Resource Servlet</servlet-name>
               <url-pattern>/seam/resource/*</url-pattern>
               </servlet-mapping>
              
               <!-- ************************ Seam Filter **************************** -->
              
               <filter>
               <filter-name>Seam Filter</filter-name>
               <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
               </filter>
              
               <filter-mapping>
               <filter-name>Seam Filter</filter-name>
               <url-pattern>/*</url-pattern>
               </filter-mapping>
              
              
               <!-- JSF -->
               <context-param>
               <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
               <param-value>client</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>facelets.DEVELOPMENT</param-name>
               <param-value>true</param-value>
               </context-param>
              
              
              
               <!-- ************************ Faces Servlet Mapping **************************** -->
               <servlet>
               <servlet-name>javax.faces.FacesServlet</servlet-name>
               <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
               <load-on-startup>1</load-on-startup>
               </servlet>
              
               <servlet-mapping>
               <servlet-name>javax.faces.FacesServlet</servlet-name>
               <url-pattern>*.seam</url-pattern>
               </servlet-mapping>
              
              </web-app>


              faces-config.xml

              <?xml version="1.0" encoding="UTF-8"?>
              <!DOCTYPE faces-config
              PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
               "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
              <faces-config>
               <application>
               <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
               </application>
              </faces-config>


              components.xml

              <?xml version="1.0" encoding="UTF-8"?>
              <components xmlns="http://jboss.com/products/seam/components"
               xmlns:core="http://jboss.com/products/seam/core"
               xmlns:security="http://jboss.com/products/seam/security"
               xmlns:transaction="http://jboss.com/products/seam/transaction"
               xmlns:persistence="http://jboss.com/products/seam/persistence"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
               http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.xsd
               http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.0.xsd
               http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd
               http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd">
              
               <component name="org.jboss.seam.core.init">
               <property name="myFacesLifecycleBug">true</property>
               <property name="jndiPattern">
               rdm-0.1-SNAPSHOT/#{ejbName}/local
               </property>
               <property name="debug">false</property>
               </component>
              
               <component name="org.jboss.seam.remoting.remoting">
               <property name="debug">false</property>
               </component>
              
               <core:manager conversation-timeout="120000"
               concurrent-request-timeout="500" conversation-id-parameter="cid" />
              
               <persistence:managed-persistence-context name="entityManager"
               persistence-unit-jndi-name="java:/rdmEntityManagerFactory" />
              
               <transaction:ejb-transaction />
              </components>


              I don't have any pages.xml setup, I don't think the issue is in the persistence layer therefore I haven't included my datasource.xml and persistence.xml.

              Let me know if you have any pointers. I am seriously considering starting from scratch with an example app as a template and slowly adding to it and see at which point it will start breaking.