Results 1 to 4 of 4

Thread: Can JTA run in standalone application?

  1. #1
    Join Date
    Dec 2007
    Posts
    6

    Default Can JTA run in standalone application?

    Hello,

    I have a standalone application and I am connecting to JMS source and a DB source. I would like to create a single transaction for the mutliple resources. What are my options? From what I have I need to use JTA but it is my understanding that it has to run in an App server. Could someone please set me straight? I am confused.

    Thanks,
    Brian

  2. #2
    Join Date
    Feb 2005
    Location
    Boston, MA
    Posts
    1,142

    Default

    There are standalone versions of JTA, such as JOTM. There may be others.
    Bill

  3. #3
    Join Date
    Dec 2007
    Posts
    6

    Default

    Thanks for the response. I have one more question. Can JOTM run in a console application? All of the examples I have looked at are at least using Tomcat.

    I tried a simple example

    <bean id="jotm" class="org.springframework.transaction.jta.JotmFac toryBean"/>

    <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTran sactionManager">
    <property name="userTransaction">
    <ref local="jotm"/>
    </property>
    </bean>


    I get this error.

    Exception in thread "main" org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'jotm' defined in class path resource [osbi/nfuf/server/composer/conf/application-config.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [org.springframework.transaction.jta.JotmFactoryBea n]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: javax/resource/spi/XATerminator
    Caused by: org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [org.springframework.transaction.jta.JotmFactoryBea n]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: javax/resource/spi/XATerminator
    Caused by: java.lang.NoClassDefFoundError: javax/resource/spi/XATerminator

  4. #4

    Default

    Adding the javax.resource API jar to your classpath would at the very least make the NoClassDef error go away. I don't know if that fully satisfies the missing dependencies for you though.

    http://download.java.net/maven/glass...ector-api/1.5/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •