Atomikos Forum

System properties in configuration using Spring

I am trying to instruct Atomikos to put its files in user's home directory. Here are the contents from 'transactions.properties'-

com.atomikos.icatch.output_dir=${user.home}/transactions
com.atomikos.icatch.log_base_dir=${user.home}/transactions
com.atomikos.icatch.console_file_name=my_tm.out
com.atomikos.icatch.log_base_name=my_tm.log
com.atomikos.icatch.tm_unique_name=my_tm

Here Atomikos works perfectly and puts all files under user's home directory. As we are using Spring, so I wanted to get rid of 'transactions.properties' and put this configuration in Spring configuration file as shown below-

<bean id="userTransactionService" class="com.atomikos.icatch.config.UserTransactionServiceImp" init-method="init" destroy-method="shutdownForce">
  <constructor-arg>
    <props>
      <prop key="com.atomikos.icatch.service">com.atomikos.icatch.standalone.UserTransactionServiceFactory</prop>
      <prop key="com.atomikos.icatch.output_dir">${user.home}/transactions</prop>
      <prop key="com.atomikos.icatch.log_base_dir">${user.home}/transactions</prop>
      <prop key="com.atomikos.icatch.console_file_name">my_tm.out</prop>
      <prop key="com.atomikos.icatch.log_base_name">my_tm.log</prop>
      <prop key="com.atomikos.icatch.tm_unique_name">my_tm</prop>
      <prop key="com.atomikos.icatch.console_log_level">INFO</prop>
    </props>
  </constructor-arg>
</bean>

Now instead of finding user home directory it creates a directory named ${user.home} in the current user directory and writes all files there. Should not the 'com.atomikos.icatch.config.UserTransactionServiceImp.java' parse properties passed in the constructor as well like it does in case of transactions.properties? May be I am configuring it incorrectly using Spring, if true, what is the correct way of doing so?

Thanks,
Vinod
Vinod Singh Send private email
Thursday, February 05, 2009
 
 
Hey!

You have to configure a PropertyPlaceholderConfigurer bean like this:

<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" >
        <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
</bean>

Cheers,
Martin
Martin Bengl Send private email
Thursday, February 05, 2009
 
 
Thanks, it works :-)
Vinod Singh Send private email
Friday, February 06, 2009
 
 

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

Other recent topics Other recent topics