3 Replies Latest reply on Jun 13, 2014 1:45 AM by Maciej Swiderski

    How to inject EntityManager (using CDI) into a WorkItemHandler

    raja sekhar nemani Newbie

      I have created an async custom task

      i implemented, WorkItemHandlerProducer and WorkItemHandler.

       

      I need to inject Entitymanager into WorkItemHandler.

      when i do that i am getting a NULL value for EntityManager.

       

      At the moment i am getting it as null.

      when i try to create a new database connection using Persistence.createEntityManagerFactory(), even that is throwing error, cannot find persistence unit.

       

      Any thoughts, its very urgent please.

       

      Here attached the whole project.[Removed some of the dependent hibernate jars].