Strange Atomikos exception - Error in init (): Log already in use?

We are trying to run the same web application that uses Atomikos as a transaction manager on several local resources (each of them uses the same versions of spring, atomikos, tomact, etc. with the same configuration files). Some of them work fine, but in one of them, when we try to start tomcat, we get the following exception:

Caused by: java.lang.IllegalStateException: Can't overwrite cause with java.lang.RuntimeException: Log already in use? at java.lang.Throwable.initCause(Throwable.java:456) at com.atomikos.icatch.standalone.UserTransactionServiceImp.init(UserTransactionServiceImp.java:326) at com.atomikos.icatch.config.UserTransactionServiceImp.init(UserTransactionServiceImp.java:405) at com.atomikos.icatch.config.UserTransactionServiceImp.init(UserTransactionServiceImp.java:569) at com.atomikos.icatch.jta.UserTransactionManager.startupTransactionService(UserTransactionManager.java:89) at com.atomikos.icatch.jta.UserTransactionManager.checkSetup(UserTransactionManager.java:77) at com.atomikos.icatch.jta.UserTransactionManager.init(UserTransactionManager.java:142) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1638) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1579) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509) ... 41 more Caused by: com.atomikos.icatch.SysException: Error in init(): Log already in use? ... 54 more Caused by: java.lang.RuntimeException: Log already in use? at com.atomikos.icatch.standalone.UserTransactionServiceImp.createDefault(UserTransactionServiceImp.java:203) at com.atomikos.icatch.standalone.UserTransactionServiceImp.init(UserTransactionServiceImp.java:258) 

We can’t understand what a magazine is, and google didn’t help anyone ... Does anyone know what is the cause of these strange problems? Again, we have environments with exactly the same configuration that work just fine, and another that has another weird warning: https://stackoverflow.com/questions/20936253/atomikos-with-activemq-commit-heuristic-warnings

Thanks!:)

+7
java tomcat jta atomikos
source share
6 answers

Turns out this is a resolution issue. Atomikos tried to create lck files in the eclipse folder, and as soon as we moved eclipse to another location, everything worked fine.

+1
source share

If you use more than one project (which uses Atomicos), this problem occurs due to concurrency when writing atomikos log files (error message: "Log is already in use").

To solve this problem, you must configure the log file name by specifying the 'com.atomikos.icatch.log_base_name' property in the atomikos configuration, as shown below:

 <bean id="atomikosUserTransactionService" 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.log_base_name">your_project_name_log</prop> <prop key="com.atomikos.icatch.output_dir">../standalone/log/</prop> <prop key="com.atomikos.icatch.log_base_dir">../standalone/log/</prop> </props> </constructor-arg> </bean> 

PS: Please note that I changed the properties of com.atomikos.icatch.output_dir and com.atomikos.icatch.log_base_dir to keep things organized by creating atomikos log files in the same JBoss log file directory.

+5
source share

This is a matter of resolution. I am adding this two lines to my jta.properties. (Confirm that the directory exists).

 com.atomikos.icatch.output_dir = /data/logs/XXX/ com.atomikos.icatch.log_base_dir = /data/logs/XXX/ 
+3
source share

Go to the destination where atomikos logs are generated. There you will see various 0 byte lock files that need to be deleted. This problem is observed when the last time the application was launched, it was disconnected incorrectly. As soon as you delete the lck files, and then try to deploy the application, the problem will be solved.

+1
source share

In my case, the problem was that my JBoss stopped unexpectedly in Eclipse. I tried to start it again and got this error, but actually it was because the JBoss process was still running on my machine, although Eclipse showed it to be complete. So I just killed the existing JBoss processes.

0
source share

By default, atomikos creates its own log file and lock file in the home directory of the user starting the JVM.

In the case of Tomcat8, this will be:

/ Usr / shares / tomcat8

You must check permissions for this folder. On mine, it was:

 drwxr_xr-x 3 root tomcat 4096 Feb 7 10:28 . 

This meant that the tomcat user could not write to it.

I changed it to:

 drwxrwxr-x 3 root tomcat 4096 Feb 7 10:28 . 

And everything worked perfectly.

0
source share

All Articles