1

I've developed a JPA project to be deployed into my Tomcat8 instance.

I need then to lookup my PersistenceUnit EntityManagerFactory by JNDI context lookup. I know that with JBoss Wildfly there is the possibility to use:

<property name="jboss.entity.manager.factory.jndi.name" value="java:/persistence/JNDIUnitNAME"/>

property which allows me to lookup the EntityManagerFactory by the standard JNDI lookup method.

InitialContext txt = new InitialContext();
EntityManagerFactory emf = (EntityManagerFactory)ctx.lookup("java:/persistence/JNDIUnitNAME");

Is there a similar property for Tomcat server?

Alex
  • 1,515
  • 2
  • 22
  • 44

0 Answers0