title: JSF 2 ManagedProperty injection of bean from dependency jar
body: <p>I'm trying to get a ManagedProperty injection working, where the injected bean resides in a jar included in my web application.</p>
  
  <p>Bean to be injected:</p>
  
  <pre><code>@ManagedBean(name="messages")  
  @SessionScoped  
  public class Messages implements Serializable
  {
  </code></pre>
  
  <p>Receiving bean:</p>
  
  <pre><code>@ManagedProperty(value="#{messages}")
  private Messages messages;
  
  public void setMessages(Messages messages)
  {
      this.messages = messages;
  }
  </code></pre>
  
  <p>However, this doesn't work and I'm just getting the message "Unable to set property messages for managed bean".
  If I put the Messages class in the same package as the receiving bean instead of having it in it's own jar, it works just fine.</p>