[jboss-dev-forums] [Design of POJO Server] - Re: migrating TransactionManager and Invokers to POJO

jhalliday do-not-reply at jboss.com
Mon Mar 31 09:37:33 EDT 2008


Another week, another exciting chapter in the migration saga...

I remove the transaction manager mbean from transaction-service.xml and put a bean in transaction-bean.xml instead:

<?xml version="1.0" encoding="UTF-8"?>
  | <deployment xmlns="urn:jboss:bean-deployer:2.0">
  |     <bean name="TransactionManager" class="com.arjuna.ats.jbossatx.jta.TransactionManagerService">
  |         <property name="transactionTimeout">300</property>
  |         <property name="objectStoreDir">${jboss.server.data.dir}/tx-object-store</property>
  |     </bean>
  | </deployment>
  | 

That works ok, the bean is instantiated and create is called on it. Woohoo.

Then lots of things break, because they depend on "jboss:service=TransactionManager", so I try to persuade my shiny new POJO to cross-dress as a JMX mbean:

<?xml version="1.0" encoding="UTF-8"?>
  | <deployment xmlns="urn:jboss:bean-deployer:2.0">
  | 
  |     <bean name="MBeanExporter" class="org.jboss.system.microcontainer.jmx.ServiceControllerLifecycleCallback">
  |         <property name="serviceController"><inject bean="JMXKernel" property="serviceController"/></property>
  |     </bean>
  |     <bean name="TransactionManager" class="com.arjuna.ats.jbossatx.jta.TransactionManagerService">
  |       <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss:service=TransactionManager", exposedInterface=com.arjuna.ats.jbossatx.jta.TransactionManagerServiceMBean.class, registerDirectly=true)</annotation>
  | 
  |         <property name="transactionTimeout">300</property>
  |         <property name="objectStoreDir">${jboss.server.data.dir}/tx-object-store</property>
  | 
  |         <install bean="MBeanExporter" method="install">
  |            <parameter><inject fromContext="context"/></parameter>
  |         </install>
  |         <uninstall bean="MBeanExporter" method="uninstall">
  |            <parameter><inject fromContext="context"/></parameter>
  |         </uninstall>
  |     </bean>
  | 
  | </deployment>
  | 

So now I get two copies of the transaction manager bean instantiated. Huh? I want one instance, not two. Where the heck did the other one come from? I guess perhaps I've not expressed the desired config properly? I want one object behaving as both a bean and an mbean, not two separeate objects. Is there some other way of achieving that?

I also have problems because some things are not happening in the right order. Before either create or start is called on the transaction manager bean I see something that depends on it being started. Huh? This does not follow my understanding of the lifecycle, which is that dependent objects should not move into a state until everything they depend on has achieved at least an equivalently advanced state. Does the required state need to be specified explicitly on the CachedConnectionManager? Or perhaps this behaviour is something to do with the CCM being an mbean whilst the TM is a bean?

14:22:54,750 ERROR [AbstractKernelController] Error installing to Start: name=jboss.jca:service=CachedConnectionManager state=Create mode=Manual requiredState=Installed
  | java.lang.ExceptionInInitializerError
  |         at org.jboss.resource.connectionmanager.CachedConnectionManager.startService(CachedConnectionManager.java:191)
  | ...
  | Caused by: java.lang.RuntimeException: Unable to locate the transaction manager
  |         at org.jboss.tm.TransactionManagerLocator.locate(TransactionManagerLocator.java:105)
  | ...
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4140135#4140135

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4140135



More information about the jboss-dev-forums mailing list