title: EJB @PostConstruct not called
body: <p>When I want to invoke a method with @PostConstruct, the method is not invoked. I don't get any errors or logs from the server. Do I have to add some configuration xml files or add additional annotations to invoke the method?</p>
  
  <p>Serlvet:</p>
  
  <pre><code>public class PersonServlet extends HttpServlet {
  
      private static final long serialVersionUID = 1L;
      private static final Logger LOG = LoggerFactory.getLogger(PersonServlet.class);
  
      @EJB
      Storage storage;
  
      protected void service(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {
        try {
          HttpSession session = req.getSession(true);
          storage = (Storage) session.getAttribute(Storage.class.getName());
          if (storage == null) {
             storage = new Storage();
             session.setAttribute(Storage.class.getName(), storage);
          }     
          // create odata handler and configure it with CsdlEdmProvider and Processor
          OData odata = OData.newInstance();
          ServiceMetadata edm = odata.createServiceMetadata(new PersonEdmProvider(), new ArrayList&lt;EdmxReference&gt;());
          ODataHttpHandler handler = odata.createHandler(edm);
          handler.register(new PersonEntityCollectionProcessor(storage));
          handler.register(new PersonEntityProcessor(storage));
          handler.register(new PersonPrimitiveProcessor(storage));
  
          // let the handler do the work
          handler.process(req, resp);
        } catch (RuntimeException e) {
          LOG.error("Server Error occurred in ExampleServlet", e);
          throw new ServletException(e);
        }
      }
  }
  </code></pre>
  
  <p>PersonDAO</p>
  
  <pre><code>@Stateless
  public class PersonDAO {
  
      @PersistenceContext
      private EntityManager em;
  
      public List&lt;Person&gt; getAllPersons() {
  
          return 
              em.createQuery("SELECT p FROM T_Person p", Person.class).getResultList();
  
      }
  
  }
  </code></pre>
  
  <p>Storage:</p>
  
  <pre><code>@Stateless
  public class Storage {
  
      @EJB
      PersonDAO psDAO;
  
      private List&lt;Entity&gt; personList;
  
      public Storage() {
          personList = new ArrayList&lt;Entity&gt;();
      }
  
      @PostConstruct
       private void initSampleData(){
           psDAO.getAllPersons();
      }
  }
  </code></pre>
  
  <p>PersonEntityCollectionProcessor:</p>
  
  <pre><code>public class PersonEntityCollectionProcessor implements EntityCollectionProcessor {
  
      private OData odata;
      private ServiceMetadata serviceMetadata;
      private Storage storage;
  
      public PersonEntityCollectionProcessor(Storage storage) {
          this.storage = storage;
      }
  
      public void init(OData odata, ServiceMetadata serviceMetadata) {
          this.odata = odata;
          this.serviceMetadata = serviceMetadata;
      }
  
  }
  </code></pre>