fixed nullpointer when bean is not added in persistence.xml, leading to invalid error messages