8 Replies Latest reply on Sep 12, 2006 11:24 AM by Tobias Adamson

    seam + ajax4jsf + facelets

    dudududu Novice

      I tried to install ajax4jsf

      in my face-config i've

       <!-- Facelets support -->
      
       <application>
       <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
       </application>
      
       <lifecycle>
       <phase-listener>org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener</phase-listener>
       </lifecycle>
      

      in my web.xml i added
       <filter>
       <display-name>Ajax4jsf Filter</display-name>
       <filter-name>ajax4jsf</filter-name>
       <filter-class>org.ajax4jsf.FastFilter</filter-class>
       </filter>
       <filter-mapping>
       <filter-name>ajax4jsf</filter-name>
       <url-pattern>*.seam</url-pattern>
       </filter-mapping>
      
       <context-param>
       <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
       <param-value>com.sun.facelets.FaceletViewHandler</param-value>
       </context-param>
       <context-param>
       <param-name>org.ajax4jsf.Filter</param-name>
       <param-value>org.ajax4jsf.FastFilter</param-value>
       </context-param>


      I put the ajax and oscache jars under server\default\deploy\jbossweb-tomcat55.sar\jsf-libs

      I tried one of ajax4jsf example and I got exception for my s:link tags,I changed those to a4j:commandLink tags but I'm still getting exceptions
      while using the ajax4jsf (i.e onkeyup)
      here is the exception i am getting:

      10:10:47,494 ERROR [PhaseListenerManager] Exception in PhaseListener RENDER_RESPONSE(6) beforePhase.
      java.lang.IllegalStateException: No phase id bound to current thread
       at org.jboss.seam.contexts.PageContext.getPhaseId(PageContext.java:116)
       at org.jboss.seam.contexts.PageContext.isRenderResponsePhase(PageContext.java:128)
       at org.jboss.seam.contexts.PageContext.getCurrentReadableMap(PageContext.java:62)
       at org.jboss.seam.contexts.PageContext.get(PageContext.java:52)
       at org.jboss.seam.contexts.Contexts.lookupInStatefulContexts(Contexts.java:125)
       at org.jboss.seam.Component.getInstance(Component.java:1322)
       at org.jboss.seam.jsf.SeamVariableResolver.resolveVariable(SeamVariableResolver.java:44)
       at org.apache.myfaces.config.LastVariableResolverInChain.resolveVariable(LastVariableResolverInChain.java:42)
       at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:134)
       at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:65)
       at com.sun.el.parser.AstValue.getValue(AstValue.java:106)
       at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:192)
       at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
       at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:56)
       at javax.faces.component.UIOutput.getValue(UIOutput.java:77)
       at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getStringValue(RendererUtils.java:217)
       at org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.renderOutput(HtmlTextRendererBase.java:69)
       at org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.encodeEnd(HtmlTextRendererBase.java:57)
       at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:536)
       at org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:241)
       at org.ajax4jsf.framework.renderer.AjaxContainerRenderer.encodeAjaxChild(AjaxContainerRenderer.java:197)
       at org.ajax4jsf.framework.renderer.AjaxContainerRenderer.encodeAjaxChild(AjaxContainerRenderer.java:190)
       at org.ajax4jsf.framework.renderer.AjaxContainerRenderer.encodeAjax(AjaxContainerRenderer.java:126)
       at org.ajax4jsf.ajax.UIAjaxRegion.encodeAjax(UIAjaxRegion.java:224)
       at org.ajax4jsf.framework.ajax.AjaxContext.renderAjaxRegion(AjaxContext.java:172)
       at org.ajax4jsf.framework.renderer.AjaxRenderPhaseListener.processAjaxRender(AjaxRenderPhaseListener.java:254)
       at org.ajax4jsf.framework.renderer.AjaxRenderPhaseListener.beforePhase(AjaxRenderPhaseListener.java:230)
       at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersBefore(PhaseListenerManager.java:70)
       at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:373)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:97)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:65)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:226)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:45)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      10:10:47,504 ERROR [STDERR] 26/08/2006 10:10:47 com.sun.facelets.FaceletViewHandler handleRenderException
      SEVERE: Error Rendering View[/newfile.jsp]
      com.sun.facelets.tag.TagAttributeException: /WEB-INF/incl/login.jsp @8,39 test="#{loggedIn==null}" No phase id bound to current thread
       at com.sun.facelets.tag.TagAttribute.getObject(TagAttribute.java:235)
       at com.sun.facelets.tag.TagAttribute.getBoolean(TagAttribute.java:79)
       at com.sun.facelets.tag.jstl.core.ChooseWhenHandler.isTestTrue(ChooseWhenHandler.java:49)
       at com.sun.facelets.tag.jstl.core.ChooseHandler.apply(ChooseHandler.java:67)
       at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
       at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
       at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
       at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
       at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
       at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:143)
       at com.sun.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:60)
       at com.sun.facelets.tag.ui.DefineHandler.apply(DefineHandler.java:58)
       at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:128)
       at com.sun.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:306)
       at com.sun.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:279)
       at com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:68)
       at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
       at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
       at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
       at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
       at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
       at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
       at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
       at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:143)
       at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:113)
       at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
       at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
       at com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95)
       at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:510)
       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:553)
       at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:97)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:65)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:226)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:45)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.IllegalStateException: No phase id bound to current thread
       at org.jboss.seam.contexts.PageContext.getPhaseId(PageContext.java:116)
       at org.jboss.seam.contexts.PageContext.isRenderResponsePhase(PageContext.java:128)
       at org.jboss.seam.contexts.PageContext.getCurrentReadableMap(PageContext.java:62)
       at org.jboss.seam.contexts.PageContext.get(PageContext.java:52)
       at org.jboss.seam.contexts.Contexts.lookupInStatefulContexts(Contexts.java:125)
       at org.jboss.seam.Component.getInstance(Component.java:1322)
       at org.jboss.seam.jsf.SeamVariableResolver.resolveVariable(SeamVariableResolver.java:44)
       at org.apache.myfaces.config.LastVariableResolverInChain.resolveVariable(LastVariableResolverInChain.java:42)
       at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:134)
       at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:65)
       at com.sun.el.parser.AstEqual.getValue(AstEqual.java:41)
       at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:192)
       at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
       at com.sun.facelets.tag.TagAttribute.getObject(TagAttribute.java:233)
       ... 62 more
      10:10:47,514 ERROR [SeamExceptionFilter] uncaught exception handled by Seam
      javax.servlet.ServletException: /WEB-INF/incl/login.jsp @8,39 test="#{loggedIn==null}" No phase id bound to current thread
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:97)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:65)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:226)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:45)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      10:10:47,534 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
      com.sun.facelets.tag.TagAttributeException: /WEB-INF/incl/login.jsp @8,39 test="#{loggedIn==null}" No phase id bound to current thread
       at com.sun.facelets.tag.TagAttribute.getObject(TagAttribute.java:235)
       at com.sun.facelets.tag.TagAttribute.getBoolean(TagAttribute.java:79)
       at com.sun.facelets.tag.jstl.core.ChooseWhenHandler.isTestTrue(ChooseWhenHandler.java:49)
       at com.sun.facelets.tag.jstl.core.ChooseHandler.apply(ChooseHandler.java:67)
       at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
       at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
       at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
       at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
       at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
       at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:143)
       at com.sun.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:60)
       at com.sun.facelets.tag.ui.DefineHandler.apply(DefineHandler.java:58)
       at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:128)
       at com.sun.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:306)
       at com.sun.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:279)
       at com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:68)
       at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
       at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
       at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
       at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
       at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
       at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
       at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
       at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:143)
       at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:113)
       at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
       at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
       at com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95)
       at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:510)
       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:553)
       at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:97)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:65)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:226)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:45)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.IllegalStateException: No phase id bound to current thread
       at org.jboss.seam.contexts.PageContext.getPhaseId(PageContext.java:116)
       at org.jboss.seam.contexts.PageContext.isRenderResponsePhase(PageContext.java:128)
       at org.jboss.seam.contexts.PageContext.getCurrentReadableMap(PageContext.java:62)
       at org.jboss.seam.contexts.PageContext.get(PageContext.java:52)
       at org.jboss.seam.contexts.Contexts.lookupInStatefulContexts(Contexts.java:125)
       at org.jboss.seam.Component.getInstance(Component.java:1322)
       at org.jboss.seam.jsf.SeamVariableResolver.resolveVariable(SeamVariableResolver.java:44)
       at org.apache.myfaces.config.LastVariableResolverInChain.resolveVariable(LastVariableResolverInChain.java:42)
       at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:134)
       at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:65)
       at com.sun.el.parser.AstEqual.getValue(AstEqual.java:41)
       at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:192)
       at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
       at com.sun.facelets.tag.TagAttribute.getObject(TagAttribute.java:233)
       ... 62 more
      


      I really would like to use ajax4jsf and i've no idea how to fix it and if it is can really work for me...

      loggedIn is a key in the context...(I took the included login.xhtml from the dvd example..)

        • 1. Re: seam + ajax4jsf + facelets
          Gus Gu Expert

          I have the same problem when I integrate ajax4jsf into seam + facelets, but it seems you need to comment or remove the following codes in your faces-config.xml according to ajax4jsf developer document.

          <application>
           <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
           </application>


          • 2. Re: seam + ajax4jsf + facelets
            adambrod Newbie

            I am having this same problem. I have configured Facelets correctly, but I get a NPE because PageContext's call to Lifecycle.getPhaseId() - that returns null.

            Does anybody have any ideas for what could cause this?

            • 3. Re: seam + ajax4jsf + facelets
              adambrod Newbie

              Here is the relevant part of web.xml

              <listener>
               <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
               </listener>
              
               <!-- 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>
               <servlet-name>Faces Servlet</servlet-name>
               </filter-mapping>
              
               <!-- Needed to ensure safe tx cleanup when using Seam-managed sessions/persistence contexts -->
               <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>
               <servlet-name>Faces Servlet</servlet-name>
               </filter-mapping>


              • 4. Re: seam + ajax4jsf + facelets
                adambrod Newbie

                And this is from faces-config.xml

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


                • 5. Re: seam + ajax4jsf + facelets
                  adambrod Newbie

                  Actually, my stack trace is slightly different. Here is the relevant part of the stack trace:

                  2006-09-11 18:02:59,525 ERROR org.apache.myfaces.lifecycle.PhaseListenerManager - Exception in PhaseListener RESTORE_VIEW(1) afterPhase
                  java.lang.NullPointerException
                   at org.jboss.seam.contexts.PageContext.getCurrentReadableMap(PageContext.java:62)
                   at org.jboss.seam.contexts.PageContext.get(PageContext.java:52)
                   at org.jboss.seam.contexts.Contexts.lookupInStatefulContexts(Contexts.java:125)
                   at org.jboss.seam.Component.getInstance(Component.java:1245)
                   at org.jboss.seam.jsf.SeamVariableResolver.resolveVariable(SeamVariableResolver.java:44)
                   at org.apache.shale.tiger.faces.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:188)
                   at org.apache.shale.faces.ShaleVariableResolver.resolveVariable(ShaleVariableResolver.java:152)
                   at org.springframework.web.jsf.DelegatingVariableResolver.resolveVariable(DelegatingVariableResolver.java:108)
                   at org.apache.myfaces.config.LastVariableResolverInChain.resolveVariable(LastVariableResolverInChain.java:42)
                   at org.apache.shale.view.faces.ViewViewHandler.setupViewController(ViewViewHandler.java:285)
                   at org.apache.shale.view.faces.ViewViewHandler.createView(ViewViewHandler.java:130)
                   at org.apache.myfaces.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:143)
                   at org.jboss.seam.jsf.SeamNavigationHandler.handleNavigation(SeamNavigationHandler.java:35)
                   at org.apache.shale.dialog.faces.DialogNavigationHandler.handleNavigation(DialogNavigationHandler.java:196)
                   at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:89)
                   at org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl.java:181)
                   at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:66)
                   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
                  


                  • 6. Re: seam + ajax4jsf + facelets
                    Tobias Adamson Newbie

                    Hi
                    We have this combination working.
                    As we are using the fastfilter you need to donwload and have nekohtml.jar and xerces in your classpath

                    Here are our config files
                    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>
                    
                     <!-- 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>
                    
                     <context-param>
                     <param-name>facelets.LIBRARIES</param-name>
                     <param-value>/WEB-INF/tomahawk.taglib.xml;/WEB-INF/joda.taglib.xml;/WEB-INF/keybroker.taglib.xml</param-value>
                     </context-param>
                    
                     <context-param>
                     <param-name>org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION</param-name>
                     <param-value>50</param-value>
                     </context-param>
                    
                     <!--context-param>
                     <param-name>org.apache.myfaces.SERIAL_FACTORY</param-name>
                     <param-value>com.keybroker.util.JbossSerialFactory</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>*.jsf</url-pattern>
                     </servlet-mapping>
                    
                     <servlet>
                     <servlet-name>Seam Remoting</servlet-name>
                     <servlet-class>org.jboss.seam.remoting.SeamRemotingServlet</servlet-class>
                     </servlet>
                    
                     <servlet-mapping>
                     <servlet-name>Seam Remoting</servlet-name>
                     <url-pattern>/seam/remoting/*</url-pattern>
                     </servlet-mapping>
                    
                     <!-- Seam filters -->
                     <!-- Ajax4JSF Initial parameters -->
                     <filter>
                     <display-name>Ajax4jsf Filter</display-name>
                     <filter-name>ajax4jsf</filter-name>
                     <filter-class>org.ajax4jsf.framework.ajax.xmlfilter.NekkoFilter</filter-class>
                     <init-param>
                     <param-name>forceparser</param-name>
                     <param-value>true</param-value>
                     </init-param>
                     <init-param>
                     <param-name>enable-cache</param-name>
                     <param-value>false</param-value>
                     </init-param>
                     </filter>
                     <filter-mapping>
                     <filter-name>ajax4jsf</filter-name>
                     <url-pattern>/*</url-pattern>
                     </filter-mapping>
                    
                     <context-param>
                     <param-name>org.ajax4jsf.SKIN</param-name>
                     <param-value>DEFAULT</param-value>
                     </context-param>
                    
                    
                    
                    
                     <context-param>
                     <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
                     <param-value>com.sun.facelets.FaceletViewHandler</param-value>
                     </context-param>
                    
                    
                    
                     <!-- 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>*.jsf</url-pattern>
                     </filter-mapping>
                    
                     <filter>
                     <filter-name>Seam Servlet Filter</filter-name>
                     <filter-class>org.jboss.seam.servlet.SeamServletFilter</filter-class>
                     </filter>
                    
                    
                     <!-- MyFaces -->
                     <listener>
                     <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
                     </listener>
                    
                     <filter>
                     <filter-name>ExtensionsFilter</filter-name>
                     <filter-class>
                     org.apache.myfaces.webapp.filter.ExtensionsFilter
                     </filter-class>
                     <init-param>
                     <param-name>uploadMaxFileSize</param-name>
                     <param-value>10m</param-value>
                     </init-param>
                     <init-param>
                     <param-name>uploadThresholdSize</param-name>
                     <param-value>100k</param-value>
                     </init-param>
                     </filter>
                     <filter-mapping>
                     <filter-name>ExtensionsFilter</filter-name>
                     <servlet-name>Faces Servlet</servlet-name>
                     </filter-mapping>
                     <filter-mapping>
                     <filter-name>ExtensionsFilter</filter-name>
                     <url-pattern>*.jsf</url-pattern>
                     </filter-mapping>
                     <filter-mapping>
                     <filter-name>ExtensionsFilter</filter-name>
                     <url-pattern>/faces/*</url-pattern>
                     </filter-mapping>
                    </web-app>
                    


                    faces-config.xml
                    .....
                     <lifecycle>
                     <phase-listener>org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener</phase-listener>
                     </lifecycle>
                    
                    </faces-config>
                    


                    Hope this helps.
                    Regards
                    Tobias

                    • 7. Re: seam + ajax4jsf + facelets
                      Christian Sommer Newbie

                      hello tobad,
                      the configuration as described above works fine, but I have no conversation propagation anymore after changing my web.xml like that.

                      Do you have the same problem, or even a hint for me? this is 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-class>org.jboss.seam.servlet.SeamListener</listener-class>


                      <!-- Propagate conversations across redirects -->

                      <filter-name>Seam Redirect Filter</filter-name>
                      <filter-class>org.jboss.seam.servlet.SeamRedirectFilter</filter-class>


                      <filter-mapping>
                      <filter-name>Seam Redirect Filter</filter-name>
                      <url-pattern>*.seam</url-pattern>
                      </filter-mapping>


                      <!-- JSF MyFaces -->

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


                      <filter-mapping>
                      <filter-name>MyFacesExtensionsFilter</filter-name>
                      <!-- servlet-name must match the name of your javax.faces.webapp.FacesServlet entry -->
                      <servlet-name>Faces Servlet</servlet-name>
                      </filter-mapping>

                      <filter-mapping>
                      <filter-name>MyFacesExtensionsFilter</filter-name>
                      <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
                      </filter-mapping>

                      <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-name>Faces Servlet</servlet-name>
                      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                      <load-on-startup>1</load-on-startup>


                      <servlet-mapping>
                      <servlet-name>Faces Servlet</servlet-name>
                      <url-pattern>*.seam</url-pattern>
                      </servlet-mapping>


                      <servlet-name>Seam Remoting</servlet-name>
                      <servlet-class>org.jboss.seam.remoting.SeamRemotingServlet</servlet-class>


                      <servlet-mapping>
                      <servlet-name>Seam Remoting</servlet-name>
                      <url-pattern>/seam/remoting/*</url-pattern>
                      </servlet-mapping>

                      <!-- MyFaces -->

                      <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>


                      <context-param>
                      <param-name>facelets.LIBRARIES</param-name>
                      <param-value>/WEB-INF/tomahawk.taglib.xml; /WEB-INF/rossmann.taglib.xml</param-value>
                      </context-param>

                      <!-- projects own servlet -->

                      <servlet-name>MonitorServlet</servlet-name>
                      <servlet-class>de.rossmann.productlisting.servlet.ShowMonitorServlet</servlet-class>
                      <load-on-startup>2</load-on-startup>


                      <servlet-mapping>
                      <servlet-name>MonitorServlet</servlet-name>
                      <url-pattern>*.jpeg</url-pattern>
                      </servlet-mapping>

                      <!-- Ajax4JSF Initial parameters -->

                      <display-name>Ajax4jsf Filter</display-name>
                      <filter-name>ajax4jsf</filter-name>
                      <filter-class>org.ajax4jsf.framework.ajax.xmlfilter.NekkoFilter</filter-class>
                      <init-param>
                      <param-name>forceparser</param-name>
                      <param-value>true</param-value>
                      </init-param>
                      <init-param>
                      <param-name>enable-cache</param-name>
                      <param-value>false</param-value>
                      </init-param>

                      <filter-mapping>
                      <filter-name>ajax4jsf</filter-name>
                      <url-pattern>*.seam</url-pattern>
                      </filter-mapping>

                      <context-param>
                      <param-name>org.ajax4jsf.SKIN</param-name>
                      <param-value>DEFAULT</param-value>
                      </context-param>

                      <context-param>
                      <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
                      <param-value>com.sun.facelets.FaceletViewHandler</param-value>
                      </context-param>


                      <session-config>
                      <session-timeout>600</session-timeout>
                      </session-config>

                      <error-page>
                      <exception-type>
                      javax.servlet.ServletException
                      </exception-type>

                      /productlisting/timeout.seam

                      </error-page>
                      </web-app>

                      • 8. Re: seam + ajax4jsf + facelets
                        Tobias Adamson Newbie

                        Hi
                        Probably due to this

                         <filter-mapping>
                         <filter-name>Seam Redirect Filter</filter-name>
                         <url-pattern>*.jsf</url-pattern>
                         </filter-mapping>
                        


                        I.e you use *.seam and i use *.jsf
                        change it and see what happens

                        /Tobias