-
Feb 11th, 2008, 02:29 PM
#1
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
-
Feb 11th, 2008, 03:01 PM
#2
There are standalone versions of JTA, such as JOTM. There may be others.
Bill
-
Feb 11th, 2008, 04:51 PM
#3
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
-
Feb 12th, 2008, 10:39 AM
#4
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
-
Forum Rules