1 Reply Latest reply on Jan 10, 2012 6:58 AM by Jiri Hofman

    Facelets composition tag attribute value expression + a4j:poll

    Jiri Hofman Newbie

      Hello,

       

      I am experiencing weird behavior during expression evaluation with Richfaces 4.1.0 Final. I have a facelets composition bound to a tag

       

       

      The "bean" is passed to the composition tag via tag's attribute

       

       

      I am getting following error for a4j:poll auto=requests (other a4j components work OK during ajax requests)

       

      javax.el.PropertyNotFoundException: Target Unreachable, identifier 'bean' resolved to null: javax.faces.el.EvaluationException: javax.el.PropertyNotFoundException: Target Unreachable, identifier 'bean' resolved to null     at com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:95) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]     at javax.faces.component.UICommand.broadcast(UICommand.java:308) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]     at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]     at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]     at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]     at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]     at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.7.Final.jar:]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.7.Final.jar:]     at cz.broadridge.stm.web.util.STMFilter.doFilter(STMFilter.java:299) [classes:]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.7.Final.jar:]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.7.Final.jar:]     at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.7.Final.jar:]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.7.Final.jar:]     at cz.broadridge.stm.web.util.STMFilter.doFilter(STMFilter.java:299) [classes:]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.7.Final.jar:]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.7.Final.jar:]     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.7.Final.jar:]     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.7.Final.jar:]     at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:151) [jboss-as-web-7.1.0.CR1b.jar:7.1.0.CR1b]     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.7.Final.jar:]     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.7.Final.jar:]     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.7.Final.jar:]     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.7.Final.jar:]     at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:897) [jbossweb-7.0.7.Final.jar:]     at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:626) [jbossweb-7.0.7.Final.jar:]     at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:2033) [jbossweb-7.0.7.Final.jar:]     at java.lang.Thread.run(Thread.java:662) [:1.6.0_27] Caused by: javax.el.PropertyNotFoundException: Target Unreachable, identifier 'bean' resolved to null     at org.apache.el.parser.AstValue.getTarget(AstValue.java:98) [jbossweb-7.0.7.Final.jar:]     at org.apache.el.parser.AstValue.invoke(AstValue.java:244) [jbossweb-7.0.7.Final.jar:]     at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278) [jbossweb-7.0.7.Final.jar:]     at com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]     ... 29 more

       

      Thanks for any help!

        • 1. Re: Facelets composition tag attribute value expression + a4j:poll
          Jiri Hofman Newbie

          It looks like this blog eat all the code. So once again:

           

          Tag composition "foo:myTag":

               <ui:composition>

                    <a4j:poll interval="1000" action="#{bean.refreshList}" rendered="#{autoRefresh}" render="#{id}" execute="@this" ontimer="return (counter == 0);">

               </ui:composition>

           

          Tag usage:

               <foo:myTag bean="#{PageBean}" />

           

          The poll request resulted in the above exception:

           

          SOLUTION: There is a bug in richfaces. AjaxPollHandler passes deprecated MethodBinding which is not aware of facelets context, i.e. #{bean} was resolved as null.

          You must use undocumented "actionExpression" attribute. "actionListener" does not work neither.