Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7673577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:32:37+00:00 2026-05-31T16:32:37+00:00

I am working on distributed transactions. I am trying to implement XA transaction using

  • 0

I am working on distributed transactions. I am trying to implement XA transaction using Atomikos as the Transaction Manager. One of my issues is being able to get a “XADataSource” from the DB2 database hosted on the Websphere 6.1 server.
I am using jndi lookup to get the Datasource as below:

Context ctx=new InitialContext();
XADataSource ds = (XADataSource) ctx.lookup(dataSourceName);

However, this lookup causes the following exception:

[3/21/12 12:08:47:551 EDT] 00000026 SystemErr     R java.lang.ClassCastException: com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource incompatible with javax.sql.XADataSource
[3/21/12 12:08:47:551 EDT] 00000026 SystemErr     R     at com.BusinessEntities.JndiConn.<init>(JndiConn.java:21)
[3/21/12 12:08:47:551 EDT] 00000026 SystemErr     R     at com.Servlet.InitialServlet.doGet(InitialServlet.java:41)
[3/21/12 12:08:47:551 EDT] 00000026 SystemErr     R     at com.Servlet.InitialServlet.doPost(InitialServlet.java:186)
[3/21/12 12:08:47:551 EDT] 00000026 SystemErr     R     at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
[3/21/12 12:08:47:551 EDT] 00000026 SystemErr     R     at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
[3/21/12 12:08:47:551 EDT] 00000026 SystemErr     R     at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1101)
[3/21/12 12:08:47:566 EDT] 00000026 SystemErr     R     at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:569)
[3/21/12 12:08:47:566 EDT] 00000026 SystemErr     R     at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
[3/21/12 12:08:47:566 EDT] 00000026 SystemErr     R     at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3440)
[3/21/12 12:08:47:566 EDT] 00000026 SystemErr     R     at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267)
[3/21/12 12:08:47:566 EDT] 00000026 SystemErr     R     at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:815)
[3/21/12 12:08:47:566 EDT] 00000026 SystemErr     R     at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1461)
[3/21/12 12:08:47:566 EDT] 00000026 SystemErr     R     at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:118)
[3/21/12 12:08:47:566 EDT] 00000026 SystemErr     R     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
[3/21/12 12:08:47:566 EDT] 00000026 SystemErr     R     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
[3/21/12 12:08:47:566 EDT] 00000026 SystemErr     R     at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
[3/21/12 12:08:47:566 EDT] 00000026 SystemErr     R     at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
[3/21/12 12:08:47:566 EDT] 00000026 SystemErr     R     at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
[3/21/12 12:08:47:566 EDT] 00000026 SystemErr     R     at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
[3/21/12 12:08:47:566 EDT] 00000026 SystemErr     R     at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
[3/21/12 12:08:47:566 EDT] 00000026 SystemErr     R     at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
[3/21/12 12:08:47:566 EDT] 00000026 SystemErr     R     at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
[3/21/12 12:08:47:566 EDT] 00000026 SystemErr     R     at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
[3/21/12 12:08:47:566 EDT] 00000026 SystemErr     R     at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)

The same works fine if attribute “ds” is of type DataSource instead of XADataSource. But I want get XAConnections and hence require XADataSource. I have tried searching a lot but am unable to figure out how to avoid this cast exception.
Any pointers on what i should do differently?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T16:32:39+00:00Added an answer on May 31, 2026 at 4:32 pm

    You won’t be able to cast it to XADataSource.

    Both XADataSource and regular DataSource are available to you as a WSJdbcDataSource.

    WSJdbcDataSource implements WSDataSource which in turn extends DataSource.

    The connection that you have is still XA enabled if the underlying JDBC Driver hosting this datasource is XA enabled.

    Sorry I am not able to provide you with ways to getting the XADataSource as that is likely not available.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to do some bench-marking of Distributed transaction memory using Terracotta Ehcache
In my just-completed project, I was working getting distributed transactions working. We implemented this
I am working on a Windows Server 2008, the MSDTC (Distributed Transaction Coordinator) Service
I am working on a project where I've to implement Distributed File System, so
I am working on a distributed storage project. I am implemented it using Java
I have client server application using distributed object. some time my code is working
I working on a distributed mediaplayer that uses the windows media player component. Now
I'm working on a project that will be distributed with GNU autoconf/automake, and I
We're a distributed team of 5 developers working on rather large integrations project. We
I've been working on a comprehensive build system that performs distributed builds on multiple

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.