In my BaseDao , I use
@PersistenceContext(unitName = "primary")
protected EntityManager em;
to inject an EntityManager and other daos inherit from it , for example ,UserDao. In my project,I use
@Inject
private UserDao userDao;
sometimes, not everytime, it throws exception like Can not set javax.persistence.EntityManager field com.XXX.storage.dao.BaseDao.em to com.XXX.storage.dao.UserDao$Proxy$_$$_WeldSubclass ,I dont know the reason ,can anyone help me?Many thanks!