除了我们遵循文档并指定日志目录和基本名称作为-D参数之外,我们看到的内容与Strange Atomikos exception - Error in init(): Log already in use?中描述的相同。在我们的例子中,它是一个部署在一个天真的Tomcat7容器实例中的war文件。
日志中没有证据表明正在读取系统属性。
这是Atomikos的3.9.3。
tomcat7 11466 2.5 0.7 2311632 257256 ? Sl 09:13 0:19 /usr/lib/jvm/java-7-openjdk-amd64/bin/java -Djava.util.logging.config.file=/var/lib/tomca 7/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC -Dserver.properties.file=/usr/share/tomcat7/server-internal.properties -Dcom.atomikos.icatch.log_base_dir=/var/log/tomcat7/ -Dcom.atomikos.icatch.log_base_name=rest-tm -Djava.endorsed.dirs=/usr/share/tomcat7/endorsed -classpath /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar -Dcatalina.base=/var/lib/tomcat7 -Dcatalina.home=/usr/share/tomcat7 -Djava.io.tmpdir=/tmp/tomcat7-tomcat7-tmp org.apache.catalina.startup.Bootstrap start
stacktrace:
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.transaction.TransactionManager]: Factory method 'atomikosTransactionManager' threw exception; nested exception is java.lang.IllegalStateException: Can't overwrite cause with java.lang.RuntimeException: Log already in use? at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:591) ... 44 more 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.setTransactionTimeout(UserTransactionManager.java:237) at com.foo.springcontainer.config.persistence.transactionmanager.AtomikosTransactionManagerConfig.atomikosTransactionManager(AtomikosTransactionManagerConfig.java:29) at com.foo.springcontainer.config.persistence.transactionmanager.AtomikosTransactionManagerConfig$$EnhancerBySpringCGLIB$$beea75cd.CGLIB$atomikosTransactionManager$0() at com.foo.springcontainer.config.persistence.transactionmanager.AtomikosTransactionManagerConfig$$EnhancerBySpringCGLIB$$beea75cd$$FastClassBySpringCGLIB$$10e69a5.invoke() at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312) at com.foo.springcontainer.config.persistence.transactionmanager.AtomikosTransactionManagerConfig$$EnhancerBySpringCGLIB$$beea75cd.atomikosTransactionManager() at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) ... 45 more Caused by: com.atomikos.icatch.SysException: Error in init(): Log already in use? ... 62 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)
我不知道我到底应该去哪里 - 我可能希望它试图打开的任何文件名都会包含在日志中,但我会盲目飞行。除了通常的catalina和localhost日志之外,/ var / log / tomcat7中没有创建文件。
想法?
答案 0 :(得分:0)
这是因为该应用程序尚未彻底关闭,并且留下了一些残留的日志锁,进而阻止了它的启动。
您需要找到应用程序的tmlogs
文件夹。在此之下,您将找到一个.epoch
文件和一个.lck
文件。删除这些,您的应用程序应该可以正常启动。