jboss 7 中的事务管理器 bean
Transaction Manager bean in jboss 7
我们正在 jboss 7 中部署 MDB,使用 IBM MQ 作为消息传递提供程序。我们正在将 (MDB EAR) 从 IBM WAS 应用程序服务器迁移到 Jboss 在 IBM MQ 中保持消息传递。
作为迁移的一部分,我们需要将事务管理器从 IBM Web sphere App server 更改为 JBoss 特定的事务管理器。
正如您在下面看到的特定于 Web 领域的 wsTxManager bean。我们需要 Jboss 个特定的 bean。谁能帮我解决这个问题?
<bean id="wsTxManager"
class="org.springframework.transaction.jta.WebSphereTransactionManagerFactoryBean" />
<bean id="txManager"
class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="userTransactionName">
<null />
</property>
<property name="transactionManager" ref="wsTxManager" />
</bean>
日志:
7c11372: display name [org.springframework.context.support.ClassPathXmlApplicationContext@77c11372]; startup date [Tue Feb 20 17:21:42 SGT 2018]; root of context hierarchy
[2018-02-20 17:21:42,674] [default-threads - 12] [INFO ] [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - Loading XML bean definitions from URL [vfs:/content/our_app.ear/our_app.jar/beanRefContext.xml]
[2018-02-20 17:21:42,976] [default-threads - 12] [INFO ] [org.springframework.context.support.ClassPathXmlApplicationContext] - Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext@77c11372]: org.springframework.beans.factory.support.DefaultListableBeanFactory@406aa4b4
[2018-02-20 17:21:42,981] [default-threads - 12] [INFO ] [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@406aa4b4: defining beans [businessBeanFactory]; root of factory hierarchy
[2018-02-20 17:21:43,000] [default-threads - 12] [INFO ] [org.springframework.context.support.ClassPathXmlApplicationContext] - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@66b1b69e: display name [org.springframework.context.support.ClassPathXmlApplicationContext@66b1b69e]; startup date [Tue Feb 20 17:21:43 SGT 2018]; root of context hierarchy
[2018-02-20 17:21:43,000] [default-threads - 12] [INFO ] [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - Loading XML bean definitions from class path resource [app-ejb-context.xml]
[2018-02-20 17:21:43,034] [default-threads - 12] [INFO ] [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@406aa4b4: defining beans [businessBeanFactory]; root of factory hierarchy
[2018-02-20 17:21:43,045] [default-threads - 29] [INFO ] [org.springframework.context.support.ClassPathXmlApplicationContext] - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@7e92809d: display name [org.springframework.context.support.ClassPathXmlApplicationContext@7e92809d]; startup date [Tue Feb 20 17:21:43 SGT 2018]; root of context hierarchy
它应该与 JBoss 一起工作:
<bean id="containerTransaction" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>java:/TransactionManager</value>
</property>
</bean>
<bean id="jtaTransactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManager">
<ref local="containerTransaction"/>
</property>
<property name="userTransactionName">
<value>java:jboss/UserTransaction</value>
</property>
</bean>
我们正在 jboss 7 中部署 MDB,使用 IBM MQ 作为消息传递提供程序。我们正在将 (MDB EAR) 从 IBM WAS 应用程序服务器迁移到 Jboss 在 IBM MQ 中保持消息传递。 作为迁移的一部分,我们需要将事务管理器从 IBM Web sphere App server 更改为 JBoss 特定的事务管理器。
正如您在下面看到的特定于 Web 领域的 wsTxManager bean。我们需要 Jboss 个特定的 bean。谁能帮我解决这个问题?
<bean id="wsTxManager"
class="org.springframework.transaction.jta.WebSphereTransactionManagerFactoryBean" />
<bean id="txManager"
class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="userTransactionName">
<null />
</property>
<property name="transactionManager" ref="wsTxManager" />
</bean>
日志:
7c11372: display name [org.springframework.context.support.ClassPathXmlApplicationContext@77c11372]; startup date [Tue Feb 20 17:21:42 SGT 2018]; root of context hierarchy
[2018-02-20 17:21:42,674] [default-threads - 12] [INFO ] [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - Loading XML bean definitions from URL [vfs:/content/our_app.ear/our_app.jar/beanRefContext.xml]
[2018-02-20 17:21:42,976] [default-threads - 12] [INFO ] [org.springframework.context.support.ClassPathXmlApplicationContext] - Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext@77c11372]: org.springframework.beans.factory.support.DefaultListableBeanFactory@406aa4b4
[2018-02-20 17:21:42,981] [default-threads - 12] [INFO ] [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@406aa4b4: defining beans [businessBeanFactory]; root of factory hierarchy
[2018-02-20 17:21:43,000] [default-threads - 12] [INFO ] [org.springframework.context.support.ClassPathXmlApplicationContext] - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@66b1b69e: display name [org.springframework.context.support.ClassPathXmlApplicationContext@66b1b69e]; startup date [Tue Feb 20 17:21:43 SGT 2018]; root of context hierarchy
[2018-02-20 17:21:43,000] [default-threads - 12] [INFO ] [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - Loading XML bean definitions from class path resource [app-ejb-context.xml]
[2018-02-20 17:21:43,034] [default-threads - 12] [INFO ] [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@406aa4b4: defining beans [businessBeanFactory]; root of factory hierarchy
[2018-02-20 17:21:43,045] [default-threads - 29] [INFO ] [org.springframework.context.support.ClassPathXmlApplicationContext] - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@7e92809d: display name [org.springframework.context.support.ClassPathXmlApplicationContext@7e92809d]; startup date [Tue Feb 20 17:21:43 SGT 2018]; root of context hierarchy
它应该与 JBoss 一起工作:
<bean id="containerTransaction" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>java:/TransactionManager</value>
</property>
</bean>
<bean id="jtaTransactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManager">
<ref local="containerTransaction"/>
</property>
<property name="userTransactionName">
<value>java:jboss/UserTransaction</value>
</property>
</bean>