ManagedPersistenceContext.getEntityManager() has the potential to throw a NamingException because of a call to Transactions.isTransactionActive(). I believe ManagedPersistenceContext.getEntityManager() should assume that a NamingException thrown from Transactions.isTransactionActive() equates to "false".
My guess is the "throws NamingException" might be a relic of obtaining an EntityMangager from an EMF obtained through JNDI. However, that has moved to initEntityManager() that handles the error of obtaining an EMF on it's own. So, I think getEntityManager should log a NamingException thrown from Transactions.isTransactionActive() and move on as if no transaction is active.