title: RestEasy @EJB returning null
body: <p>I have a jax-rs service implemented with RestEasy, I am using Jboss as7 and have implemented a signleton ejb with the @Signleton annotation. The signleton is started when the server starts (@startup) and I would like to inject it into the jax-rs usign the @EJB. The problem is that the class is always null and I am started to get lost because in every tutorial I have looked this is the way they are injecting the ejb.
  Should I use any special xml file? what am I doing wrong?</p>
  
  <pre><code>@Path("/")
  public class Service extends Application{
  @EJB
  private GlobalStore store;
  public Service(){
  fromejbstore = store.getSentiment();//null pointer is thrown
  }
  }
  </code></pre>
  
  <p>the Signleton ejb is:</p>
  
  <pre><code>@Singleton
  @Startup
  public class GlobalStore {
   Sentiment sentiment;
   @PostConstruct
  public void initialize() {
   //do something
  }
  public Sentiment getSentiment(){return sentiment;}
  }
  </code></pre>