title: Don't know exactly what jta-data-source should be
body: <p>I tried to get Spring-MVC, Hibernate, JTA with a Postgres Server to work. </p>
  
  <p>I got most of the stuff working (Read from Db through EntityManager without JTA), but I can't get the transactions to work with JTA. </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="defaultPersistenceUnit" transaction-type="JTA"&gt;
      &lt;provider&gt;org.hibernate.jpa.HibernatePersistenceProvider&lt;/provider&gt;
      &lt;jta-data-source&gt;???&lt;/jta-data-source&gt;
      &lt;class&gt;net.test.test.database.UsersEntity&lt;/class&gt;
      &lt;exclude-unlisted-classes&gt;false&lt;/exclude-unlisted-classes&gt;
      &lt;properties&gt;
          &lt;property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect" /&gt;
          &lt;property name="javax.persistence.jdbc.driver" value="org.postgresql.Driver" /&gt;
          &lt;property name="javax.persistence.jdbc.url" value="jdbc:postgresql://localhost:5432/mydb" /&gt;
          &lt;property name="javax.persistence.jdbc.user" value="postgres"/&gt;
          &lt;property name="javax.persistence.jdbc.password" value="validpw"/&gt;
      &lt;/properties&gt;
  &lt;/persistence-unit&gt;
  </code></pre>
  
  <p></p>
  
  <p>If I provide my datasource from my servlet I get an Exception like </p>
  
  <pre><code>DataSourceLookupFailureException: Failed to look up JNDI DataSource with name 'dataSource'
  </code></pre>
  
  <p>I also found resources saying the datasource should be defined in the application-server (but I am not sure about this one). If it is important I use a Tomcat-server. </p>