6 Replies Latest reply on Dec 19, 2007 8:11 AM by maykellff

    a4j:include and Seam

    maykellff

      Hi all, i'm having an issue very strange. I have a page simple Seam application that uses intensively a4j:include component, the issue come when you try to navigate from one included page to another included page (the typical scene where the a4j:include component follows the navigation rules defined in navigation-config file to do the navigation) and the application do it, but when you see the server logs you see that an error ocurred, the error is showed above. Every single attent to navigate from one included page to another included page the server rise the error.

      I hope you can help me, thank you in advance,
      Maykell.

      09:17:43,703 WARN [lifecycle] phase(RESTORE_VIEW 1,com.sun.faces.context.FacesContextImpl@f5498f) 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.jsf.SeamVariableResolver.resolveVariable(SeamVariableResolver.java:53)
      com.sun.faces.el.VariableResolverChainWrapper.getValue(VariableResolverChainWrapper.java:100)
      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.context.AjaxContext.getCurrentInstance(AjaxContext.java:85)
      org.ajax4jsf.component.AjaxViewRoot.getViewId(AjaxViewRoot.java:439)
      org.apache.myfaces.renderkit.html.util.AutoScrollPhaseListener.afterPhase(AutoScrollPhaseListener.java:58)
      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.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(Thread.java:595)

        • 1. Re: a4j:include and Seam
          maykellff

          Please any help will be very appreciated.....


          "maykellff" wrote:
          Hi all, i'm having an issue very strange. I have a page simple Seam application that uses intensively a4j:include component, the issue come when you try to navigate from one included page to another included page (the typical scene where the a4j:include component follows the navigation rules defined in navigation-config file to do the navigation) and the application do it, but when you see the server logs you see that an error ocurred, the error is showed above. Every single attent to navigate from one included page to another included page the server rise the error.

          I hope you can help me, thank you in advance,
          Maykell.

          09:17:43,703 WARN [lifecycle] phase(RESTORE_VIEW 1,com.sun.faces.context.FacesContextImpl@f5498f) 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.jsf.SeamVariableResolver.resolveVariable(SeamVariableResolver.java:53)
          com.sun.faces.el.VariableResolverChainWrapper.getValue(VariableResolverChainWrapper.java:100)
          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.context.AjaxContext.getCurrentInstance(AjaxContext.java:85)
          org.ajax4jsf.component.AjaxViewRoot.getViewId(AjaxViewRoot.java:439)
          org.apache.myfaces.renderkit.html.util.AutoScrollPhaseListener.afterPhase(AutoScrollPhaseListener.java:58)
          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.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(Thread.java:595)


          • 2. Re: a4j:include and Seam
            maykellff

            Can anybody help me...?

            • 3. Re: a4j:include and Seam
              matt.drees

              What version of Seam are you using?

              • 4. Re: a4j:include and Seam
                maykellff

                 

                "matt.drees" wrote:
                What version of Seam are you using?

                Seam 1.2.0
                I trust in the JSF implemenattion of the JBoss server (JBoss 4.2.1 GA), richfaces 3.1.2 GA and facelets 1.1.12



                • 5. Re: a4j:include and Seam
                  matt.drees

                  Looking at your stacktrace, I think your issue is caused by using a myfaces phase listener (AutoScrollPhaseListener). I think this sort of issue was fixed in Seam 1.2.1. (http://fisheye.jboss.com/browse/JBoss/jboss-seam/src/main/org/jboss/seam/contexts/Contexts.java?r1=1.47&r2=1.48)

                  • 6. Re: a4j:include and Seam
                    maykellff

                     

                    "matt.drees" wrote:
                    Looking at your stacktrace, I think your issue is caused by using a myfaces phase listener (AutoScrollPhaseListener). I think this sort of issue was fixed in Seam 1.2.1.


                    Not, this not my case. I not use any myfaces phase listener at all, i only use Seam listeners. In any case i'll to try with Seam 1.2.1 and will see what happen.

                    This is my web.xml:
                    <?xml version="1.0"?>
                    <!--
                    * Copyright 2004 The Apache Software Foundation.
                    *
                    * Licensed under the Apache License, Version 2.0 (the "License");
                    * you may not use this file except in compliance with the License.
                    * You may obtain a copy of the License at
                    *
                    * http://www.apache.org/licenses/LICENSE-2.0
                    *
                    * Unless required by applicable law or agreed to in writing, software
                    * distributed under the License is distributed on an "AS IS" BASIS,
                    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
                    * See the License for the specific language governing permissions and
                    * limitations under the License.
                    -->
                    <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">
                    <display-name>jsfTest</display-name>

                    <!--
                    <context-param>
                    <param-name>org.jboss.seam.core.init.debug</param-name>
                    <param-value>true</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.CONFIG_FILES</param-name>
                    <param-value>/WEB-INF/navigation-rule.xml</param-value>
                    </context-param>

                    <context-param>
                    <description>State saving method: "client" or "server" (= default)
                    See JSF Specification 2.5.2</description>
                    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
                    <param-value>server</param-value>
                    </context-param>

                    <!--
                    <context-param>
                    <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
                    <param-value>true</param-value>
                    </context-param>
                    -->
                    <filter>
                    <display-name>Ajax4jsf Filter</display-name>
                    <filter-name>ajax4jsf</filter-name>
                    <filter-class>org.ajax4jsf.Filter</filter-class>
                    <init-param>
                    <param-name>forceparser</param-name>
                    <param-value>false</param-value>
                    </init-param>
                    </filter>


                    <filter-mapping>
                    <filter-name>ajax4jsf</filter-name>
                    <servlet-name>Faces Servlet</servlet-name>
                    <dispatcher>REQUEST</dispatcher>
                    <dispatcher>FORWARD</dispatcher>
                    <dispatcher>INCLUDE</dispatcher>
                    </filter-mapping>


                    <listener>
                    <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
                    </listener>

                    <!-- Faces 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-mapping>
                    <servlet-name>Faces Servlet</servlet-name>
                    <url-pattern>*.seam</url-pattern>
                    </servlet-mapping>
                    <servlet-mapping>
                    <servlet-name>Faces Servlet</servlet-name>
                    <url-pattern>/faces/*</url-pattern>
                    </servlet-mapping>
                    <login-config>
                    <auth-method>BASIC</auth-method>
                    </login-config>
                    </web-app>



                    (http://fisheye.jboss.com/browse/JBoss/jboss-seam/src/main/org/jboss/seam/contexts/Contexts.java?r1=1.47&r2=1.48)

                    and this is my faces-config.xml:
                    <?xml version="1.0"?>
                    <!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>
                    <converter>
                    <converter-id>genericselectarrayconvertidor</converter-id>
                    <converter-class>com.web.converter.GenericSelectArrayConvertidor</converter-class>
                    </converter>

                    <converter>
                    <converter-id>genericselectarrayconvertidor1</converter-id>
                    <converter-class>com.web.converter.GenericSelectArrayConvertidor1</converter-class>
                    </converter>


                    <converter>
                    <converter-id>genericselectlistconvertidor</converter-id>
                    <converter-class>com.web.converter.GenericSelectListConvertidor</converter-class>
                    </converter>


                    <managed-bean>
                    <managed-bean-name>carBean</managed-bean-name>
                    <managed-bean-class>com.web.CarBean</managed-bean-class>
                    <managed-bean-scope>request</managed-bean-scope>
                    </managed-bean>

                    <managed-bean>
                    <managed-bean-name>navigationBean</managed-bean-name>
                    <managed-bean-class>com.web.NavigationBean</managed-bean-class>
                    <managed-bean-scope>request</managed-bean-scope>
                    </managed-bean>


                    <lifecycle>
                    <phase-listener>org.jboss.seam.jsf.TransactionalSeamPhaseListener</phase-listener>
                    </lifecycle>


                    <application>
                    <locale-config>
                    <default-locale>en</default-locale>
                    </locale-config>
                    <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
                    </application>
                    </faces-config>