title: Spring Entity Manager Factory using JNDI
body: <p>I am getting confused on how to get the entity Manager Factory in spring spring-datasource.xml using <br>
  I did the following :</p>
  
  <p>spring-datasource.xml file:</p>
  
  <pre><code>&lt;tx:jta-transaction-manager id="transactionManager" /&gt;
  &lt;tx:annotation-driven mode="proxy"
  transaction-manager="transactionManager" /&gt;
  
  &lt;jee:jndi-lookup id="entityManagerFactory" jndi-name="jdbc/mysqldatasource" /&gt;
  </code></pre>
  
  <p>persistence.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;persistence version="2.0"
  xmlns="http://java.sun.com/xml/ns/persistence"      
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="
             http://java.sun.com/xml/ns/persistence 
             http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"&gt;
  &lt;persistence-unit name="ebankingUnit"
      transaction-type="JTA"&gt;
      &lt;jta-data-source&gt;jdbc/mysqldatasource&lt;/jta-data-source&gt;
      &lt;class&gt;com.datamodel.Product&lt;/class&gt;
  
      &lt;properties&gt;
          &lt;property name="eclipselink.logging.level" value="INFO" /&gt;
          &lt;property name="eclipselink.query-results-cache.expiry"
              value="5000" /&gt;
          &lt;property name="eclipselink.ddl-generation" value="create-tables" /&gt;
          &lt;property name="hibernate.hbm2ddl.auto" value="none" /&gt;
      &lt;/properties&gt;
  &lt;/persistence-unit&gt;
  </code></pre>
  
  <p>                                              </p>
  
  <p>but I am getting thid</p>