Hi Suresh,
Looking at your code it looks like you are trying to obtain an XADataSource directly and unnecessarily.
When performing a JNDI lookup try casting the returned object to the javax.sql.DataSource interface. Then use the DataSource to obtain a reference to java.sql.Connection. This is still true even though you have configured the datasource connection configuration in db2-xa-ds.xml with an XA compliant object. Your application code does not and
should not know the underlying (XA) implementation class.
Why does it not need to care ?
Behind the scenes JBoss is intercepting the call to javax.sql.DataSource.getConnection() and returning to the application a wrapped Connection object. The JBoss wrapper in this particular case is WrapperDataSource. First line of the stack trace.
The wrapping of the Connection object allows JBoss to pool the physical Connection objects. When an application requests a Connection the JBoss connection pool allocates a logical Connetion for the duration an application needs it.
Additionally, because the Connection object is wrapped the call to Connetion.commit() or Connection.abort() is also intercepted. This frees you from having to worry about controlling the distributed transaction interaction.
Try the suggestion above and let us know how you progress.
Regards,
Jeremy
SCJP, SCWCD