title: Spring + Spring Data JPA Configuration
body: <p>currently I'm fooling around with a Spring setup. My goal is to use JPA to get access to a Websphere datasource using it's JNDI name. I'm using Spring Data JPA to make life easier for me and worked through some tutorials to get the basic idea. </p>
  
  <p>Bad thing: none of those is talking about the Spring configuration for my JPA szenario + I never worked with JPA / JDBC before. 
  So I hope you can help me out here. I got 2 configuration files: </p>
  
  <p>applicationContext.xml
      </p>
  
  <pre><code>&lt;bean id="txManager"
      class="org.springframework.orm.jpa.JpaTransactionManager"&gt;
      &lt;property name="sessionFactory" ref="sessionFactory" /&gt;
  &lt;/bean&gt;
  &lt;tx:annotation-driven transaction-manager="txManager" /&gt;
  
  &lt;bean id="eManager" class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean"&gt;&lt;/bean&gt;
  </code></pre>
  
  <p>Since i'm using the @Transactual annotion within my code, i'm using the annotation-driven tag for the txManager. I'm just not really sure what else i should configure for the txManager and what the sessionFactory tag is doing. Is there any documentation for all supported XML tags? Am I missing a importent tag for my szenario?</p>
  
  <p>Same about eManager - not sure if thats right in any way. </p>
  
  <p>persistence.xml</p>
  
  <pre><code>&lt;persistence version="1.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_1_0.xsd"&gt;
      &lt;persistence-unit name="spring-jpa"&gt;
          &lt;jta-data-source&gt;jdbc/myJNDI&lt;/jta-data-source&gt;
      &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>
  
  <p>Same thing here: don't really know what i'm doing. I know i need a persistence unit / provider. I know that many are using hibernate for this, but i would like to stay native and use pure JavaEE / Spring if possible. 
  I'm just not sure how to configure that.
  Currently my project is crashing, telling me: "JPA PersistenceProvider returned null"</p>