java.lang.NullPointerException
at info.novatec.beantest.producers.EntityManagerProducer.getEntityManager(EntityManagerProducer.java:79)
...
Currently, the producer method getEntityManager also prints logs regarding the persistenceContext and the defining bean instance.
LOGGER.debug("PersistenceContext info:");
//This could happen if the application injects the EntityManager via @Inject instead of @PersistenceContext
if(ctx != null) {
LOGGER.debug("Unit name: {}", ctx.unitName());
}
LOGGER.debug("Bean defining the injection point: {}", ip.getBean().getBeanClass());
LOGGER.debug("Field to be injected: {}", ip.getMember());
Note that the retrieval of the bean class is not safe here ip.getBean().
Currently, the producer method
getEntityManager
also prints logs regarding the persistenceContext and the defining bean instance.Note that the retrieval of the bean class is not safe here
ip.getBean()
.