1 Reply Latest reply on Aug 28, 2009 4:09 PM by Yuhong Zhang

    action is called twice in facelet custom tag

    Yuhong Zhang Newbie

      I have a custom tag. In there, there is an an a4j:commandLink

      So I put together a facelet custom tag looks like this

      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:a="http://richfaces.org/a4j"
       xmlns:rich="http://richfaces.org/rich">
       .....
       <a:commandLink value="#{value}"
       action="#{action}"
       ajaxSingle="true"
       reRender="#{reRender}">
       <h:graphicImage value="#{icon}" />
       </a:commandLink>
       ......
      </ui:composition>
      


      The use of the tag looks like this
      .....
      <my:firstTag value="Test"
       action="#{bean.doSomething()}
       icon="img/arrow.gif"
       reRender="theForm">
      </my:firstTagr>
      ......
      


      The tag displayed well. If I clink on the link, the doSomething() is called OK. But a few moments later, I got and exception that looks like this
      Caused by: javax.el.MethodNotFoundException: /WEB-INF/tag/firstT.xhtml @11,27 action="#{action}": Identity 'action
      ' was null and was unable to invoke
       at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:72)
       at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:8
      8)
       ... 55 more
      16:04:08,550 WARNING [lifecycle] #{action}: javax.el.MethodNotFoundException: /WEB-INF/tag/firstTag.xhtml @11,27 act
      ion="#{action}": Identity 'action' was null and was unable to invoke
      javax.faces.FacesException: #{action}: javax.el.MethodNotFoundException: /WEB-INF/tag/firstTag.xhtml @11,27 action="
      #{action}": Identity 'action' was null and was unable to invoke
       at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:110)
       at javax.faces.component.UICommand.broadcast(UICommand.java:387)
       at org.ajax4jsf.component.AjaxActionComponent.broadcast(AjaxActionComponent.java:55)
       at org.ajax4jsf.component.UIDataAdaptor.broadcast(UIDataAdaptor.java:1364)
       at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
       at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
       at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
       at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)
       at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
       at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
       at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
       at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
       at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
       at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
       at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
       at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
       at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.jav
      a:126)
       at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java
      :70)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Thread.java:619)
      Caused by: javax.faces.el.MethodNotFoundException: javax.el.MethodNotFoundException: /WEB-INF/tag/firstTag.xhtml @11
      ,27 action="#{action}": Identity 'action' was null and was unable to invoke
       at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:9
      2)
       at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
       ... 54 more
      Caused by: javax.el.MethodNotFoundException: /WEB-INF/tag/firstTag.xhtml @11,27 action="#{action}": Identity 'action
      ' was null and was unable to invoke
       at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:72)
       at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:8
      8)
       ... 55 more
      16:04:08,550 SEVERE [lifecycle] JSF1054: (Phase ID: INVOKE_APPLICATION 5, View ID: /organizationSearch.xhtml) Exception
      thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@150c032]