Atomikos Forum

How to set com.atomikos.icatch.output_dir from Spring?

I don't have a jta.properties file for my project as I set everything from Spring.  However, I cannot figure out how to set the output_dir property. 

Here's my Spring transaction manager config as it stands now:

    <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
        <property name="transactionManager" ref="atomikosTransactionManager" />
        <property name="userTransaction" ref="atomikosUserTransaction" />
    </bean>

    <bean id="atomikosTransactionManager" class="com.atomikos.icatch.jta.UserTransactionManager"
        init-method="init" destroy-method="close">
        <!-- When close is called, should we force transactions to terminate? -->
        <property name="forceShutdown" value="false" />
    </bean>

    <bean id="atomikosUserTransaction" class="com.atomikos.icatch.jta.UserTransactionImp">
        <!-- Number of seconds before transaction timesout. -->
        <property name="transactionTimeout" value="30" />
    </bean>
Dave Vree Send private email
Thursday, July 15, 2010
 
 
Guy Pardon Send private email
Friday, July 16, 2010
 
 
Must have read that 20 times.  But never saw that part about handing a collection of properties to the constructor of the userTransactionService.  Probably because I don't currently have that bean, but I'll go ahead and give it a try.  Thanks.
Dave Vree Send private email
Friday, July 16, 2010
 
 
OK -- I used the advanced Spring XML config verbatim but it seems like I am getting two instances of the transaction server somehow. 

For example I get the usual error output doubled:

No properties path set - looking for transactions.properties in classpath...
transactions.properties not found - looking for jta.properties in classpath...
Failed to open transactions properties file - using default values
No properties path set - looking for transactions.properties in classpath...
transactions.properties not found - looking for jta.properties in classpath...
Failed to open transactions properties file - using default values

And if I try to use a log administrator I get this error:

java.lang.IllegalStateException: Second control registered
    at com.atomikos.icatch.admin.imp.LocalLogAdministrator.registerLogControl(LocalLogAdministrator.java:209)
    at com.atomikos.icatch.system.Configuration.installLogControl(Configuration.java:256)
    at com.atomikos.icatch.standalone.UserTransactionServiceImp.init(UserTransactionServiceImp.java:291)
    at com.atomikos.icatch.config.UserTransactionServiceImp.init(UserTransactionServiceImp.java:389)
    at com.atomikos.icatch.config.UserTransactionServiceImp.init(UserTransactionServiceImp.java:581)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)


And if I don't set the output_dir at all I get this error repeated over and over:

ERROR: the specified log seems to be in use already. Make sure that no other instance is running, or kill any pending process if needed.
java.lang.RuntimeException: Log already in use?

And finally, if I do set the output_dir correctly, I get two sets of files...one in the new directory, and one set in the original currently directory.
Dave Vree Send private email
Friday, July 16, 2010
 
 
OK,

Just set startupTransactionService=false on the UserTransactionManager...

HTH
Guy Pardon Send private email
Friday, July 16, 2010
 
 
Guy -- thanks for the fast help.  It works just fine now.  It also eliminated the pesky output to stderr complaining it couldn't find a jta.properties file.

For the record I had to add:

depends-on="userTransactionService"

to the user transaction bean in order to force the order -- otherwise I got a "transaction service not running" error.
Dave Vree Send private email
Friday, July 16, 2010
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics