tomcat - java:comp/UserTransaction is not bound in the context using btm and spring -


I am trying to configure bitronix with spring as my JTA manager:

  & lt;! - Betonix Transaction Manager Embedded Configuration - & gt; & Lt; Bean id = "xaDataSource" class = "bitronix.tm.resource.jdbc.PoolingDataSource" init-method = "init" delete-method = "off" & gt; & Lt; Property Name = "SquareName" value = "bitronix.tm.resource.jdbc.lrc.LrcXADataSource" /> & Lt; Property Name = "Exclusive" value = "java / ds1" /> & Lt; Property Name = "Maxpool Size" value = "5" /> & Lt; Property Name = "minPoolSize" value = "0" /> & Lt; Property Name = "Permission Local Transaction" value = "False" /> & Lt; Property Name = "testQuery" value = "SELECT 1 FROM DUAL" /> & Lt; Property Name = "Driver Properties" & gt; & Lt; Theater Content & gt; & Lt; Prop key = "user" & gt; Users & lt; / Prop & gt; & Lt; Support key = "password" & gt; Users & lt; / Prop & gt; & Lt; Prop key = "url" & gt; Url & lt; / Prop & gt; & Lt; Prop key = "driverClassName" & gt; Oracle.jdbc.OracleDriver & lt; / Prop & gt; & Lt; / Theater & gt; & Lt; / Property & gt; & Lt; / Bean & gt; & Lt; Bean id = "BTM Conflict" factory-method = "Received Configuration" class = "BetonixTam Transgenizer Services" & gt; & Lt; Property Name = "Server ID" Value = "Spring-BTM" /> & Lt; / Bean & gt; & Lt; Bean id = "bitronixTransactionManager" factory-method = "getTransactionManager" class = "bitronix.tm.TransactionManagerServices" Depend-on = "BTM Config, xaDataSource" destroy-method = "shutdown" /> & Lt; Bean id = "jtaTransactionManager" class = "org.springframework.transaction.jta.JtaTransactionManager" & gt; & Lt; Property Name = "transactionManager" ref = "bitronixTransactionManager" /> & Lt; Property Name = "User Transaction" ref = "BitTront Transaction Manager" / & gt; & Lt; / Bean & gt; & Lt ;! - Betronix Transaction Manager End Embedded Configuration - & gt;   

I think the bitronix is ​​initializing and running:

  399 DEBUG (PoolingDataSource.java:84) - with Java / DS1 connection Building XA Pool (S) etc.).   

But when I try: datasource DS = (Datasource) IC .lookup (" Java: comp / usertransaction ");

I get the naming exception.

Why is that so? Why do I need to configure more?

Edit

I have seen that & lt; Transactions & gt; Transaction manager take care of it.

Is it not a dispute that I define it in both tombs and in spring?

Try adding it to your web app's Meta-INF / Context.xml:

  & lt; Context & gt; & Lt; Transaction factory = "bitronix.tm.bitronixUserTransactionObjectFactory" /> & Lt; / Context & gt;   

It should only be bound to the transaction manager for this particular web app under the name java: comp / UserTransaction.

Comments