Atomikos Forum

Is jta.properties required to be on classpath?

I am trying to use the "file" property to indicate where Atomikos (v 3.6.4) should find my jta.properties file:

    <bean id="userTransactionService" class="com.atomikos.icatch.config.UserTransactionServiceImp"
        init-method="init" destroy-method="shutdownForce">
        <constructor-arg>
            <props>
                <prop key="com.atomikos.icatch.file">/etc/myapp/jta.properties</prop>
                <prop key="com.atomikos.icatch.service">com.atomikos.icatch.standalone.UserTransactionServiceFactory</prop>
                <prop key="com.atomikos.icatch.output_dir">target/</prop>
                <prop key="com.atomikos.icatch.log_base_dir">target/</prop>
            </props>
        </constructor-arg>
    </bean>

The jta.properties file is still not being found.  The /etc/myapp directory is not on the classpath.  Is this a problem?
Dave Vree Send private email
Thursday, November 18, 2010
 
 
Have you got a chance to take a look at this one
http://www.atomikos.com/Documentation/JtaProperties

It clearly points these points
1) You can do so by creating a jta.properties file at the root of your classpath.

2) java -Dcom.atomikos.icatch.file=<path_to_your_file> ...

You need either of them to get it working!

Regards,
-VK
Vicky Kak Send private email
Friday, November 19, 2010
 
 
Thanks.  I've read that page many times, but for whatever reason it doesn't seem to work.

Are you saying that that property cannot be set via Spring? 

I've also tried to set the property via $JAVA_OPTS and that didn't work either.  I am wondering if the file HAS to be on the classpath AND you set it via the file property....
Dave Vree Send private email
Friday, November 19, 2010
 
 
After examining the source code I answered my own question.  No, it does not have to be on the classpath.  However, the property cannot be set via Spring because it MUST be a system property.  In the case of Maven, for example, I had to provide it via the surefire plugin argList configuration.
Dave Vree Send private email
Saturday, November 20, 2010
 
 
You can set the file path it via the file property and you can do set the path via Spring.
Write a Bean which does set this (simple setProperty call on the SystemProperties and let the Atomikos Bean depends on that bean (via depends-on). Tell if you need an detailed code example.
Torsten Krah Send private email
Sunday, January 09, 2011
 
 

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

Other recent topics Other recent topics