This content has been marked as final. Show 3 replies
You can use the JNVIView mbean to see all of the names in JNDI.
I have done some research on this topic and I had to do this to get an EntityManagerFactory using JNDI:
In my persistence.xml:
<properties> <property name="jboss.entity.manager.factory.jndi.name" value="java:/persistence/solicitacoes" /> </properties>
Now I can use the code:
EntityManagerFactory emf = (EntityManagerFactory) new InitialContext().lookup( "java:/persistence/solicitacoes"); EntityManager em = emf.createEntityManager();
Is this the "official" way or is there a simple one?
Yes, that is the official way.