title: Can't access managed bean again... jsf
body: <p>I'm not sure what am I doing wrong. I had the same problem with another Project of mine where I could not access the managed beans.</p>
  
  <p>Here is the facelet client:</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='UTF-8' ?&gt;
  &lt;!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;ui:composition xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
              xmlns:h="http://xmlns.jcp.org/jsf/html"
              xmlns:p="http://xmlns.jcp.org/jsf/passthrough"
              xmlns:c="http://java.sun.com/jsp/jstl/core"
              xmlns="http://www.w3.org/1999/xhtml"
              template="./template.xhtml"
              xmlns:f="http://xmlns.jcp.org/jsf/core"&gt;
  
  &lt;ui:define name="left"&gt;
      &lt;h:form&gt;
          &lt;h:inputTextarea value="#{blogmanager.blogEntity.text}" p:placeholder="Tweet max 30 chars." style="width: 100%; height:150px; resize: none;" /&gt;&lt;br/&gt;&lt;br/&gt;
          &lt;h:commandButton value="Tweet" action="#{blogmanager.save}" /&gt;
      &lt;/h:form&gt;
  &lt;/ui:define&gt;
  
  &lt;ui:define name="right"&gt;
      &lt;c:forEach items="#{blogManager.blogs()}" var="item"&gt;
          &lt;h:outputText value="#{blogManager.item.text}" /&gt;&amp;nbsp;&amp;nbsp;
          Likes: &amp;nbsp;&amp;nbsp;&lt;h:outputText value="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;
          &lt;h:commandLink action="" value="like"&gt;
              &lt;f:param name="tweetid" value="" /&gt;
              &lt;f:param name="username" value="" /&gt;
          &lt;/h:commandLink&gt;&amp;nbsp;&lt;br /&gt;
          &lt;textarea&gt;
              &lt;h:outputText value="" /&gt;
          &lt;/textarea&gt;
      &lt;/c:forEach&gt;
  &lt;/ui:define&gt;
  </code></pre>
  
  <p></p>
  
  <p>This is the managed bean:</p>
  
  <pre><code>@Named("blogmanager")
  @SessionScoped
  public class BlogManager implements Serializable {
  private Blog BlogEntity;
  
  @EJB
  private BlogFacade BlogFacade;
  
  @PostConstruct
  public void init(){
      BlogEntity = new Blog();
  }
  
  public Blog getBlogEntity(){
      return this.BlogEntity;
  }
  
  public void setBlogEntity(Blog BlogEntity){
      this.BlogEntity = BlogEntity;
  }
  
  public void save(){
      BlogFacade.create(BlogEntity);
  }
  
  public void delete(){
      BlogFacade.remove(BlogEntity);
  }
  
  public void deleteBlog(@QueryParam("blogid") int id){
      BlogFacade.deleteBlog(id);
  }
  
  public List&lt;Blog&gt; getBlogs(){
      return BlogFacade.getBlogs();
  }
  }
  </code></pre>
  
  <p>When trying to use the commandButton "Tweet" I get this message: /index.xhtml @13,156 value="#{blogmanager.blogEntity.text}": Target Unreachable, identifier 'blogmanager' resolved to null</p>
  
  <p>What am I doing wrong? The IDE Netbeans recognizes the managedbean in the facelet and suggests message bean specific methods and entities.</p>
  
  <p>Stack trace:</p>
  
  <pre><code>javax.el.PropertyNotFoundException: /index.xhtml @13,156 value="#{blogmanager.blogEntity.text}": Target Unreachable, identifier 'blogmanager' resolved to null
  at com.sun.faces.facelets.el.TagValueExpression.getType(TagValueExpression.java:100)
  at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getConvertedValue(HtmlBasicInputRenderer.java:95)
  at javax.faces.component.UIInput.getConvertedValue(UIInput.java:1046)
  at javax.faces.component.UIInput.validate(UIInput.java:976)
  at javax.faces.component.UIInput.executeValidate(UIInput.java:1249)
  at javax.faces.component.UIInput.processValidators(UIInput.java:712)
  at javax.faces.component.UIForm.processValidators(UIForm.java:253)
  at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1261)
  at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1261)
  at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:1195)
  at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
  at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
  at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646)
  at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
  at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
  at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
  at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
  at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357)
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)
  at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:188)
  at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
  at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
  at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
  at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
  at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
  at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
  at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
  at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
  at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
  at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
  at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
  at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
  at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
  at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
  at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
  at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
  at java.lang.Thread.run(Thread.java:744)
        Caused by: javax.el.PropertyNotFoundException: Target Unreachable, identifier 'blogmanager' resolved to null
  at com.sun.el.parser.AstValue.getTarget(AstValue.java:174)
  at com.sun.el.parser.AstValue.getType(AstValue.java:86)
  at com.sun.el.ValueExpressionImpl.getType(ValueExpressionImpl.java:201)
  at org.jboss.weld.el.WeldValueExpression.getType(WeldValueExpression.java:93)
  at com.sun.faces.facelets.el.TagValueExpression.getType(TagValueExpression.java:98)
  </code></pre>