I would like to get an object implementing XADataSource interface from JNDI.
You don't need to do that .
Connections obtained from the xa-datasource Or local-xa-datasource enlists the XAResource associated with the Connection in the ongoing Transaction (TM) , this is mentioned in the JCA specs .
From the Hibernate post I can make out that you need to configure the JOTM within Jboss .
All you need to do is to configure the JOTM in Jboss , then things would work perfectly . I would not advice you to go with JOTM (TM) implementaion , you can go with the Arjuna which comes with Jboss as default .
I am unable to find the link explaining the configurations details of JOTM in Jboss .
thank you very much. You have turned me on right way. I have succesfully run the distributed transaction in two message driven beans.
I had to make some changes to com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinar
I don't know if it is bug or not. I hope somebody will tell me on the JBoss Transaction forum.
The discussion is here