Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

We're trying to run the same web application that uses Atomikos as transaction manager on several local envrionments (each of those 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 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 figure out what's the log in question, and google wasn't much help either...Anyone know what the cause of this strange issues? Again, we have environments with the exact same configuration that work fine, and another that has another strange warning: https://stackoverflow.com/questions/20936253/atomikos-with-activemq-commit-heuristic-warnings

Thanks! :)

like image 965
Ayelet Avatar asked Jan 09 '14 08:01

Ayelet


1 Answers

Go to the destination where atomikos logs are getting generated. Over there you will observe various 0 byte lock files which need to be deleted. This issue is observed when the last time the application was run it was shut down incorrectly. Once you delete the lck files and then try deploying the application the issue would be resolved

like image 123
Pratik Shelar Avatar answered Sep 20 '22 19:09

Pratik Shelar