JBoss recipe of the day
The @PersistenceUnit and <persistence-unit-ref> elements can be used within Servlets and JSPs to access EntityManagerFactory only.
You cannot inject EntityManagers directly into web components. Unfortunately, again, Tomcat doesn't support them, so you have to lookup the EntityManagerFactory in JNDI.
To be able to do that you need to set the jboss.entity.manager.factory.jndi.name property in your persistence.xml file:
Then from your web application: