2 Replies Latest reply on Apr 26, 2009 11:37 AM by Milton Freedman

    Target Unreachable, identifier 'user' resolved to null

    Milton Freedman Newbie

      I am learning richfaces, and have run into a problem early on that I cannot resolve.


      I have am simply trying to fire a method in my managed bean from an a4j command button. However, I continually get the exception below.

      "Target Unreachable, identifier 'user' resolved to null"

      JSP file snippet:

      <body>
       <a4j:form>
       <rich:panel>
       <f:facet name="header">
       JBoss RichFaces
       </f:facet>
       An example data table displaying member names
       <rich:dataTable value="#{testBean.members}" var="user" id="memberdata">
       <h:column>
       <h:outputText id="name" value="#{user.name}"/>
       </h:column>
       </rich:dataTable>
       <a4j:commandButton reRender="memberdata" action="#{user.doSomething}" value="Update"/>
       </rich:panel>
       </a4j:form>
       </body>


      Managed Bean (request scope)
      
      public class TestBean {
      
       private List<Members> members;
      
       public TestBean() {
       this.members = new ArrayList<Members>();
       this.members.add(new Member("Ted");
      
       }
      
       public void doSomething() {
       System.out.println("Doing Something!");
       }
      
       public List<Members> getMembers() {
       return members;
       }
      
       public void setMembers(List< Members > members) {
       this.members = members;
       }
      }
      
      


      Faces-Config:
      <?xml version="1.0" encoding="UTF-8"?>
      <faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee"
       xmlns:xi="http://www.w3.org/2001/XInclude"
       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">
       <managed-bean>
       <managed-bean-name>testBean</managed-bean-name>
       <managed-bean-class>com.test.TestBean</managed-bean-class>
       <managed-bean-scope>request</managed-bean-scope>
       </managed-bean>
       <application>
       <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
       </application>
      </faces-config>
      
      


      The exception I get:

      SEVERE: /index.xhtml @25,91 action="#{user.doSomething}": Target Unreachable, identifier 'user' resolved to null
      javax.faces.el.EvaluationException: /index.xhtml @25,91 action="#{user.doSomething}": Target Unreachable, identifier 'user' resolved to null
       at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:73)
       at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
       at javax.faces.component.UICommand.broadcast(UICommand.java:387)
       at org.ajax4jsf.component.AjaxActionComponent.broadcast(AjaxActionComponent.java:55)
       at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:316)
       at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:291)
       at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:248)
       at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:461)
       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.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:147)
       at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:276)
       at org.ajax4jsf.Filter.doFilter(Filter.java:175)
       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:233)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Unknown Source)
      Apr 25, 2009 3:03:04 PM com.sun.faces.lifecycle.InvokeApplicationPhase execute
      WARNING: #{user.doSomething}: /index.xhtml @25,91 action="#{user.doSomething}": Target Unreachable, identifier 'user' resolved to null
      javax.faces.FacesException: #{user.doSomething}: /index.xhtml @25,91 action="#{user.doSomething}": Target Unreachable, identifier 'user' resolved to null
       at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118)
       at javax.faces.component.UICommand.broadcast(UICommand.java:387)
       at org.ajax4jsf.component.AjaxActionComponent.broadcast(AjaxActionComponent.java:55)
       at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:316)
       at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:291)
       at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:248)
       at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:461)
       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.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:147)
       at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:276)
       at org.ajax4jsf.Filter.doFilter(Filter.java:175)
       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:233)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Unknown Source)
      Caused by: javax.faces.el.EvaluationException: /index.xhtml @25,91 action="#{user.doSomething}": Target Unreachable, identifier 'user' resolved to null
       at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:73)
       at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
       ... 27 more