title: Spring JTA configuration - how to set TransactionManager?
body: <p>We configure our Spring transaction in Spring config as:</p>
  
  <pre><code>&lt;tx:jta-transaction-manager/&gt;
  </code></pre>
  
  <p>I gather this means that Spring will automatically discover the underlying JTA implementation.  So when we start up JBoss we see these messages while Spring searches:</p>
  
  <pre><code>[JtaTransactionManager] [ ] No JTA TransactionManager found at fallback JNDI location [java:comp/Tran
  sactionManager]
  javax.naming.NameNotFoundException: TransactionManager not bound
  &lt;&lt;Big stack trace&gt;&gt;    
  &lt;&lt;More of the same&gt;&gt;
  </code></pre>
  
  <p>And then eventually see:</p>
  
  <pre><code>[JtaTransactionManager] [ ] JTA TransactionManager found at fallback JNDI location [java:/Transaction
  Manager]
  [JtaTransactionManager] [ ] Using JTA UserTransaction: org.jboss.tm.usertx.client.ServerVMClientUserT
  ransaction@1f78dde
  </code></pre>
  
  <p>Question is - how can we edit our <code>&lt;tx:jta-transaction-manager/&gt;</code> tag to explicitly configure the <code>java:/Transaction Manager</code> JTA implementation so we avoid all these stack traces in the logs?  (I'd prefer not to just change the Log4J logging levels)</p>
  
  <hr>
  
  <p><strong>Update</strong>: I replaced <code>&lt;tx:jta-transaction-manager/&gt;</code> with the below config and it seems to work..  i'm guessing this is alright?</p>
  
  <pre><code>&lt;bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"&gt;
      &lt;property name="transactionManagerName" value="java:/TransactionManager"/&gt;
  &lt;/bean&gt;
  </code></pre>