2

我在 Redhat Linux 上运行的独立 Java 应用程序 (v1.6) 中使用 atomikos v3.7.0 TransactionEssentials。除了突然之间 atomikos 正在向控制台大量输出日志之外,一切都在顺利进行。我尝试了很多东西,不确定是什么原因造成的,也不知道如何控制它。是的,我已经看到了链接(如何将 Atomikos 设置为不写入控制台日志?))但这对我没有用。Java 应用程序使用消息驱动的 poj 和 spring 的 DefaultMessageListenerContainer,监听消息队列并更新 MySql 数据库。当侦听器启动时,即使没有收到消息并且应用程序应该什么都不做,它也会打印出以下日志:

createCompositeTransaction ( 300000 ): created new ROOT transaction with id 192.168.252.15.tm0000100002
commit() done (by application) of transaction 192.168.252.15.tm0000100002
createCompositeTransaction ( 300000 ): created new ROOT transaction with id 192.168.252.15.tm0000200002
commit() done (by application) of transaction 192.168.252.15.tm0000200002
createCompositeTransaction ( 300000 ): created new ROOT transaction with id 192.168.252.15.tm0000300002

现在,当侦听器关闭并再次重新启动时,它还会在下面打印日志,以及上面的日志:

协调员的本地启发式终止192.168.252.15.tm1200000016,州进行局部启发式终止,协调器192.168.252.15.tm1200100016与州委托局部启发式终止协调员192.168.252.15.tm15.tm15.tm15.tm15.tm15.tm15.tm15.tm15.tm15.tm15.tm15.tm15.tm15.tm15.tm15.tm15.tm15.tm15.tm15.tm15.tm15.tm15.tm15.tm15.tm15.tm15.tristration 2.152.12001000. state COMMITTING 协调器 192.168.252.15.tm1200200016 的本地启发式终止,状态为 COMMITTING

有什么问题吗?我该如何停止?

4

3 回答 3

2

当我切换到 slf4j(通过 log4j)并使用

<logger name="atomikos">
    <level value="error" />
</logger>

谢谢。

于 2012-02-10T14:25:55.630 回答
0

或者,您可以继续使用 log4j 并指定:log4j.logger.atomikos=ERROR

于 2012-03-02T07:56:16.810 回答
0

在我的情况下它不起作用,因为图书馆有冲突

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/Documents/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Spidly/WEB-INF/lib/slf4j-jdk14-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/Documents/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Spidly/WEB-INF/lib/slf4j-log4j12-1.5.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/Documents/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Spidly/WEB-INF/lib/weld-osgi-bundle-1.0.1-SP3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

我解决了它,在 pom.xml 上留下了多个绑定

于 2013-05-11T10:39:01.083 回答