Atomikos Forum

java.lang.RuntimeException: Log already in use ?

Hi am facing the following error, when trying to run a standalone application using Atomikos for XA transaction.

Please assist.I have read other posts and tried checking for any loc files created, but i could not find any loc files to be deleted.

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
    at com.atomikos.icatch.standalone.UserTransactionServiceImp.createDefault(UserTransactionServiceImp.java:205)


I have used below configuration to pick the jta.properties

------------------------------------

<bean id="setMyAtomikosSystemProps"
        class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
        <property name="targetObject">
            <!-- System.getProperties() -->
            <bean
                class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
                <property name="targetClass" value="java.lang.System" />
                <property name="targetMethod" value="getProperties" />
            </bean>
        </property>
        <property name="targetMethod" value="putAll" />
        <property name="arguments">
            <!-- The new Properties -->
            <util:properties>
                <prop key="com.atomikos.icatch.file">/opt/etl/monitorPrepFtpFilesMvc/jta.properties</prop>
                <prop key="com.atomikos.icatch.hide_init_file_path">true</prop>
            </util:properties>
        </property>
    </bean>

    <bean id="userTransactionService" class="com.atomikos.icatch.config.UserTransactionServiceImp"
        init-method="init" destroy-method="shutdownForce">
        <constructor-arg>
            <!-- IMPORTANT: specify all Atomikos properties here -->
            <props>
                <prop key="com.atomikos.icatch.service">
                    com.atomikos.icatch.standalone.UserTransactionServiceFactory
                </prop>
            </props>
        </constructor-arg>
        <!-- <property name="initialLogAdministrators">
            <list>
                <ref bean="localLogAdministrator" />
            </list>
        </property> -->
    </bean>

    <bean id="atomikosTransactionManager" class="com.atomikos.icatch.jta.UserTransactionManager"
        init-method="init" destroy-method="close" depends-on="userTransactionService">

        <!-- IMPORTANT: disable startup because the userTransactionService above
            does this -->
        <property name="startupTransactionService" value="false" />

        <!-- when close is called, should we force transactions to terminate or
            not? -->
        <property name="forceShutdown" value="false" />
    </bean>

    <!-- Also use Atomikos UserTransactionImp, needed to configure Spring -->
    <bean id="atomikosUserTransaction" class="com.atomikos.icatch.jta.UserTransactionImp"
        depends-on="userTransactionService">
        <property name="transactionTimeout" value="300" />
    </bean>

    <bean id="transactionManager"
        class="org.springframework.transaction.jta.JtaTransactionManager"
        depends-on="userTransactionService">
        <property name="transactionManager" ref="atomikosTransactionManager" />
        <property name="userTransaction" ref="atomikosUserTransaction" />
        <property name="allowCustomIsolationLevels" value="true" />
    </bean>

    <!-- batch -->
    <util:properties id="batchDbProperties"
        location="classpath:/META-INF/batchdb.properties" />
    <bean id="dataSource" class="com.atomikos.jdbc.AtomikosDataSourceBean"
        init-method="init" destroy-method="close" depends-on="setMyAtomikosSystemProps">
        <property name="uniqueResourceName" value="dataSource" />
        <property name="xaDataSourceClassName"
            value="com.mysql.jdbc.jdbc2.optional.MysqlXADataSource" />
        <property name="xaProperties" ref="batchDbProperties" />
        <property name="minPoolSize" value="10" />
        <property name="maxPoolSize" value="20" />
        <property name="borrowConnectionTimeout" value="30" />
        <property name="testQuery" value="select 1" />
        <property name="maintenanceInterval" value="60" />
    </bean>

    <!-- uym -->
    <util:properties id="uymDbProperties"
        location="classpath:/META-INF/uymdb.properties" />
    <bean id="uymDS" class="com.atomikos.jdbc.AtomikosDataSourceBean"
        init-method="init" destroy-method="close" depends-on="setMyAtomikosSystemProps">
        <property name="uniqueResourceName" value="uymDS" />
        <property name="xaDataSourceClassName"
            value="com.mysql.jdbc.jdbc2.optional.MysqlXADataSource" />
        <property name="xaProperties" ref="uymDbProperties" />
        <property name="minPoolSize" value="10" />
        <property name="maxPoolSize" value="20" />
        <property name="borrowConnectionTimeout" value="30" />
        <property name="testQuery" value="select 1" />
        <property name="maintenanceInterval" value="60" />
    </bean>
---------------------------------------

Logs also says:

Error starting bean with name userTransactionService defined in DaoConfig.xml: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Can'y overwrite cause.
shindhur Send private email
Thursday, August 27, 2015
 
 
Hi Does anyone has any info regarding this error ? It has led us to complete XA transaction configuration to revert.

Regards,
Shindhur R
shindhur Send private email
Monday, September 07, 2015
 
 
Hi,

Check to make sure that no two JVMs are started with the same transaction log folder / file name.

HTH
Guy Pardon Send private email
Sunday, September 13, 2015
 
 

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

Other recent topics Other recent topics