1 2 Previous Next 15 Replies Latest reply on Oct 16, 2007 3:06 AM by computabloke

    warning using richfaces

    jdefe

      I started using richfaces 3.1 with my seam application. Everything was fine until I added the jars to my WEB-INF/lib and deleted the ajax4jsf jar file.
      Now its throwing a warning even though everything seems to be working. This happens after deploy everytime I use a richfaces feature.
      For instance when I change the year or month using the calendar (not when I choose the day)

      17:08:55,000 WARN [lifecycle] phase(RESTORE_VIEW 1,com.sun.faces.context.FacesContextImpl@14f1541) threw exception: java.lang.IllegalStateException: No phase id bound to current thread (make sure you do not have two SeamPhaseListener instances installed) No phase id bound to current thread (make sure you do not have two SeamPhaseListener instances installed)
      org.jboss.seam.contexts.PageContext.getPhaseId(PageContext.java:153)
      org.jboss.seam.contexts.PageContext.isRenderResponsePhase(PageContext.java:165)
      org.jboss.seam.contexts.PageContext.getCurrentReadableMap(PageContext.java:76)
      org.jboss.seam.contexts.PageContext.get(PageContext.java:66)
      org.jboss.seam.contexts.Contexts.lookupInStatefulContexts(Contexts.java:160)
      org.jboss.seam.Component.getInstance(Component.java:1577)
      org.jboss.seam.Component.getInstance(Component.java:1572)
      org.jboss.seam.jsf.SeamELResolver.getValue(SeamELResolver.java:49)
      javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
      com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
      com.sun.faces.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:72)
      org.ajax4jsf.context.AjaxContext.getCurrentInstance(AjaxContext.java:101)
      org.ajax4jsf.event.AjaxPhaseListener.afterPhase(AjaxPhaseListener.java:75)
      com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:280)
      com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
      javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
      org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
      org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
      org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
      org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
      org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      java.lang.Thread.run(Unknown Source)
      


        • 1. Re: warning using richfaces
          jdefe

          My web.xml

          <?xml version="1.0" encoding="UTF-8"?>
          <web-app version="2.4"
           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_4.xsd">
          
           <!-- Seam -->
          
           <listener>
           <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
           </listener>
           <!-- richfaces -->
          
           <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>
           <url-pattern>*.seam</url-pattern>
           </filter-mapping>
          
           <!-- Propagate conversations across redirects -->
          
           <filter>
           <filter-name>Seam Redirect Filter</filter-name>
           <filter-class>org.jboss.seam.servlet.SeamRedirectFilter</filter-class>
           </filter>
          
           <filter-mapping>
           <filter-name>Seam Redirect Filter</filter-name>
           <url-pattern>*.seam</url-pattern>
           </filter-mapping>
          
           <filter>
           <filter-name>Seam Exception Filter</filter-name>
           <filter-class>org.jboss.seam.servlet.SeamExceptionFilter</filter-class>
           </filter>
          
           <filter-mapping>
           <filter-name>Seam Exception Filter</filter-name>
           <url-pattern>*.jsf</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>org.ajax4jsf.VIEW_HANDLERS</param-name>
           <param-value>com.sun.facelets.FaceletViewHandler</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.REFRESH_PERIOD</param-name>
           <param-value>2</param-value>
           </context-param>
          
           <context-param>
           <param-name>facelets.DEVELOPMENT</param-name>
           <param-value>true</param-value>
           </context-param>
          
           <context-param>
           <param-name>com.sun.faces.validateXml</param-name>
           <param-value>true</param-value>
           </context-param>
          
           <context-param>
           <param-name>org.richfaces.SKIN</param-name>
           <param-value>DEFAULT</param-value>
           </context-param>
          
           <servlet>
           <servlet-name>Faces Servlet</servlet-name>
           <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
           <load-on-startup>1</load-on-startup>
           </servlet>
          
           <!-- Faces Servlet Mapping -->
          
           <servlet-mapping>
           <servlet-name>Faces Servlet</servlet-name>
           <url-pattern>*.seam</url-pattern>
           </servlet-mapping>
          
          </web-app>


          • 2. Re: warning using richfaces

            What version of Seam?

            • 3. Re: warning using richfaces
              jdefe

              1.2.1

              • 4. Re: warning using richfaces

                What does your faces-config look like? That is where the SeamPhaseListener is defined

                see here
                http://docs.jboss.com/seam/1.2.1.GA/reference/en/html_single/#configuration

                You don't need to define all the separate seam filters either, just SeamFilter. Some of the other stuff like conversation propagation over redirects and the exception filter are defined in components.xml.....see the link and read the whole chapter.

                • 5. Re: warning using richfaces

                  Just an addendum.......you DON'T HAVE to specify the seam filters in components.xml, only if you want adjust the default behavior. The are automatically started with default behavior for you regardless if you define them in components.xml

                  • 6. Re: warning using richfaces
                    jdefe

                    In fact that web.xml wasnt the original one. I changed it trying to solve the problem, I found that one on a tutorial.

                    I changed my web.xml to this

                    <?xml version="1.0" encoding="UTF-8"?>
                    <web-app version="2.4"
                     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_4.xsd">
                    
                     <!-- Seam -->
                    
                     <listener>
                     <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
                     </listener>
                     <!-- richfaces -->
                    
                     <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>
                     <url-pattern>*.seam</url-pattern>
                     </filter-mapping>
                    
                     <!-- Propagate conversations across redirects -->
                    
                     <filter>
                     <filter-name>Seam Redirect Filter</filter-name>
                     <filter-class>org.jboss.seam.servlet.SeamRedirectFilter</filter-class>
                     </filter>
                    
                     <filter-mapping>
                     <filter-name>Seam Redirect Filter</filter-name>
                     <url-pattern>*.seam</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>org.ajax4jsf.VIEW_HANDLERS</param-name>
                     <param-value>com.sun.facelets.FaceletViewHandler</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>org.richfaces.SKIN</param-name>
                     <param-value>DEFAULT</param-value>
                     </context-param>
                    
                     <servlet>
                     <servlet-name>Faces Servlet</servlet-name>
                     <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                     <load-on-startup>1</load-on-startup>
                     </servlet>
                    
                     <!-- Faces Servlet Mapping -->
                    
                     <servlet-mapping>
                     <servlet-name>Faces Servlet</servlet-name>
                     <url-pattern>*.seam</url-pattern>
                     </servlet-mapping>
                    
                    </web-app>


                    My faces-config:
                    <?xml version="1.0" encoding="UTF-8"?>
                    <faces-config version="1.2"
                     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_1_2.xsd">
                    
                     <application>
                     <el-resolver>org.jboss.seam.jsf.SeamELResolver</el-resolver>
                     <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
                     </application>
                    
                     <!-- Phase listener needed for all Seam applications -->
                    
                     <lifecycle>
                     <phase-listener>org.jboss.seam.jsf.SeamPhaseListener</phase-listener>
                     </lifecycle>
                    </faces-config>
                    


                    my 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:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-1.2.xsd http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-1.2.xsd http://jboss.com/products/seam/security http://jboss.com/products/seam/security-1.2.xsd http://jboss.com/products/seam/components http://jboss.com/products/seam/components-1.2.xsd">
                    
                     <core:init debug="true" jndi-pattern="t2voice/#{ejbName}/local"/>
                     <security:identity authenticate-method="#{autenticar.autenticar}"/>
                    </components>
                    



                    • 7. Re: warning using richfaces

                      Again, you don't need your two seam filters defined in web.xml (Redirect and Exception) but you do need the SeamFilter defined, look at the example from the link I provided.

                      You also don't need the RichFaces filter.

                      • 8. Re: warning using richfaces

                        At least, you don't need the Rich Faces filter in Seam 2, not sure about Seam 1.2.1............try removing it.

                        • 9. Re: warning using richfaces
                          jdefe

                          I need rich faces filter. If I remove it I get a facesException. I also removed both filters (redirect and exception) and added the seamfilter. No change.

                          Any other idea? Thanks for the help

                          • 10. Re: warning using richfaces
                            jdefe

                            Thanks but im not using maven. Nevertheless the problem could be that the listener is loading twice, I couldnt say why.
                            Anyway, I tried to exclude jsf-impl but it didnt work. I even took the jar out from my app but it kept throwing the warning.

                            • 11. Re: warning using richfaces
                              jdefe

                              It seems it happens everytime it tries to rerender something using ajax. For example when I submit with rerender ="id" having a <seam:div id="id" />

                              • 12. Re: warning using richfaces
                                computabloke

                                I'm getting similar issues with Seam 1.2.1 GA after upgrading from RichFaces 3.0 + Ajax4Jsf to the new RichFaces 3.1.1 (and deleting old a4j jar).

                                I upgraded to RF 3.1.1 to get the recent DataTable fixes, and after a little tweaking the app loads okay.
                                However, it appears the new Ajax4Jsf breaks my SEAM Pageflows (jpdl). Now I frequently get "Illegal Navigation" messages when moving around my pages. This is because the pageflow counter (used to detect back/forward navigation) doesn't match what's expected.

                                I'm trying to track down why. I suspect it may just be the order in which the filters are executed...

                                • 13. Re: warning using richfaces
                                  pmuir

                                  Can you attach a runnable example of this to a jira issue? Thanks!

                                  • 14. Re: warning using richfaces
                                    computabloke

                                    Hi Pete.

                                    Thanks for taking an interest, sorry I don't have the time to distill a complete runnable app for Jira atm. But I'll provide some more info...

                                    pages.xml fragment:

                                    <page view-id="/jsf/wiplist.xhtml">
                                     <begin-conversation pageflow="selectClientFlow" join="true"/>
                                     </page>


                                    jpdl fragment:
                                    <pageflow-definition name="selectClientFlow" xmlns="http://jbpm.org/3/pageflow-1.0"
                                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                                     xsi:schemaLocation="http://jbpm.org/3/pageflow-1.0 pageflow-1 0.xsd">
                                    
                                     <start-page name="wipList" view-id="/jsf/wiplist.xhtml">
                                     <transition name="wipClientSearch" to="wipClientSearch" />
                                     </start-page>
                                    
                                     <page name="wipClientSearch" view-id="/jsf/wiplistclientsearch.xhtml">
                                     <transition name="close" to="wipList" />
                                     </page>
                                    
                                    </pageflow-definition>


                                    The issue occurs navigating from the app's effective 'index' page (wiplist.xhtml) to wiplistclientsearch.xhtml through a 'wipClientSearch' outcome; then clicking the 'close' button to return to wiplist.xhtml. Any subsequent navigation to this will be an 'Illegal Navigation' since FacesPage.pageFlowCounter = 0, but PageFlow.counter is 2.

                                    It's like the Page-scope FacesPage instance isn't being reloaded correctly; a new one is created, but the PageFlow doesn't know about it.

                                    This navigation system worked fine with Seam 1.2.1GA and RF 3.0.0/A4J 1.1.0.

                                    After a bit more looking around, I'm thinking http://www.jboss.com/index.html?module=bb&op=viewtopic&t=119254
                                    may have something to do with it.

                                    I'm going to try Seam 2.0CR2 and Richfaces CVS to see if they're any better (and don't cause me other issues along the way). If it's still an issue I'll Jira this for you.

                                    Thanks,
                                    David

                                    1 2 Previous Next