Feb 11th, 2008, 02:29 PM
Can JTA run in standalone application?
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.
Feb 11th, 2008, 03:01 PM
There are standalone versions of JTA, such as JOTM. There may be others.
Feb 11th, 2008, 04:51 PM
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">
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
Feb 12th, 2008, 10:39 AM
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.