Unable to access UserTransaction in DataService

Flex, Java, tips 'n tricks Add comments

Note: Just a short post to save your hair from turning gray (I know mine just did)

If you ever run into a "Unable to access UserTransaction in DataService" error when working with LCDS on Tomcat 5.5.x+, make sure you configured the Java Open Transaction Manager (JOTM) correctly. You can do this by adding the following in a project config file (META_INF/context.xml or a file named [MY_PROJECT].xml in [TOMCAT_HOME]/conf/Catalina/localhost):

XML:
  1. <Context reloadable="true">
  2.   <Transaction factory="org.objectweb.jotm.UserTransactionFactory" jotm.timeout="60"/>
  3. </Context>

Now if only the Flex Project Wizard would do this for us...


Add to Bloglines - Digg This! - del.icio.us - Stumble It! - Twit This! - Technorati links - Share on Facebook - Feedburner
 

8 Responses to “Unable to access UserTransaction in DataService”

  1. sakri Says:

    I don’t believe it?!

    At the Aircamp last week, at about 5:30 am (3.5 hours before deadline), we ran into this problem! About an hour later we gave up and went to bed!!! This blog post, one week earlier might just have resulted in a trip to Milan ;)

  2. Laurent Bouquet Says:

    Thank you, Mr Herreman, for your solution.
    Now my Flex’s application runs good !

  3. Abdul Areef Says:

    Hi Friend,

    in my application, i have layers like EJB -> Struts -> JSP, but i am trying to change the layers like EJB -> Struts -> Flex, with WebORB. i dont like to change the Layers. i dont know how i am going to achieve the Goal. for that i need your suggestion to reach the target, i am expecting your support for this,

    thanks
    areef

  4. Michael Chaize Says:

    I think there’s a mistake in your post. You can place the context.xml in the META_INF/context.xml, and not in the WEB_INF/context.xml.

    Thanks for the post by the way.

  5. pleee Says:

    THANKS, lcds is a terror to me, this was so helpful and so quick to fix it :-)

  6. bloodlust Says:

    Thank you man!!! :’)

  7. Eric de Diesbach Says:

    Amazingly simple !
    Michael Chaize rocks (epita power ;)
    Thanks to both of you

  8. jitendra jain Says:

    Hi friends,

    I’m getting this Casting error. Any clues ??

    Exception: flex.data.DataServiceException: Unable to access UserTransaction in DataService.
    at flex.data.DataServiceTransaction.doBegin(DataServiceTransaction.java:1162)
    at flex.data.DataServiceTransaction.begin(DataServiceTransaction.java:1114)
    at flex.data.DataService.serviceTransactedMessage(DataService.java:747)
    at flex.data.DataService.serviceMessage(DataService.java:465)
    at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1503)
    at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:884)
    at flex.messaging.endpoints.RTMPConnection.handleTCCommand(RTMPConnection.java:723)
    at flex.messaging.endpoints.RTMPConnection.serviceTCMessage(RTMPConnection.java:1033)
    at flex.messaging.endpoints.RTMPConnection.doRead(RTMPConnection.java:515)
    at flex.messaging.endpoints.RTMPProtocolHandler.doRead(RTMPProtocolHandler.java:123)
    at flex.messaging.socketserver.Connection$ConnectionReader.run(Connection.java:788)
    at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
    at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.ClassCastException: org.objectweb.jotm.Current cannot be cast to javax.transaction.UserTransaction
    at flex.data.DataServiceTransaction.doBegin(DataServiceTransaction.java:1143)
    … 13 more

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in