PDA

View Full Version : UserTranaction not found during Jboss MDB Deployment



pburleson
Jan 13th, 2005, 01:44 PM
We have a MDB that extends Spring's AbstractJmsMessageDrivenBean and we pass it the list of spring context files for building the Application Context.

During this building, services are createed that depend on the JtaTransactionManager from Spring. The JtaTransactionManager works fine in our Web app. But when JBoss does its first create of our MDB, Spring throws an exception that it can't find the UserTransaction at the normal jndi location.

Anyone know why it would work from within the Webapp, but not from the MDB?

Thanks,
Patrick

jensv
Jan 21st, 2005, 01:25 AM
JBoss has a differrent JNDI name for the UserTransaction: you have to explicitly set the userTransactionName property of the JtaTransactionManager to UserTransaction in the applicationContext:

<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransaction Manager">
<property name="userTransactionName"><value>UserTransaction</value></property>
</bean>

Hope this helps
Jens

pburleson
Jan 21st, 2005, 09:58 AM
JBoss has a differrent JNDI name for the UserTransaction: you have to explicitly set the userTransactionName property of the JtaTransactionManager to UserTransaction in the applicationContext:

<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransaction Manager">
<property name="userTransactionName"><value>UserTransaction</value></property>
</bean>

Hope this helps
Jens

Well, I can understand that, but when our code is loaded from a Web App ( the exact same applicationContext.xml file) it works fine. JtaTransactionManager finds UserTransaction. I'm still trying to figure out what's going on in the MDB.

Patrick