SLF4J:对类型为[com.datastax.driver.core.Responses $ Result $ Rows]的对象的toString()调用失败

时间:2014-10-17 00:28:00

标签: cassandra slf4j

使用

  • cassandra core:2.1.0
  • slf4j:slf4j-api-1.7.6.jar
  • slf4j-log4j:slf4j-log4j12-1.7.2.jar

我在tomcat catalina.out中打印此消息的频率非常高,而且应用程序中没有任何功能损失:

SLF4J: Failed toString() invocation on an object of type [com.datastax.driver.core.Responses$Result$Rows]
com.datastax.driver.core.exceptions.InvalidTypeException: Invalid 32-bits integer value, expecting 4 bytes but got 20
        at com.datastax.driver.core.TypeCodec$IntCodec.deserializeNoBoxing(TypeCodec.java:672)
        at com.datastax.driver.core.TypeCodec$IntCodec.deserialize(TypeCodec.java:667)
        at com.datastax.driver.core.TypeCodec$IntCodec.deserialize(TypeCodec.java:634)
        at com.datastax.driver.core.TypeCodec$ListCodec.deserialize(TypeCodec.java:922)
        at com.datastax.driver.core.TypeCodec$ListCodec.deserialize(TypeCodec.java:848)
        at com.datastax.driver.core.DataType.deserialize(DataType.java:546)
        at com.datastax.driver.core.Responses$Result$Rows.toString(Responses.java:430)
        at org.slf4j.helpers.MessageFormatter.safeObjectAppend(MessageFormatter.java:305)
        at org.slf4j.helpers.MessageFormatter.deeplyAppendParameter(MessageFormatter.java:277)
        at org.slf4j.helpers.MessageFormatter.arrayFormat(MessageFormatter.java:231)
        at ch.qos.logback.classic.spi.LoggingEvent.getFormattedMessage(LoggingEvent.java:298)
        at ch.qos.logback.classic.spi.LoggingEvent.prepareForDeferredProcessing(LoggingEvent.java:208)
        at ch.qos.logback.core.OutputStreamAppender.subAppend(OutputStreamAppender.java:206)
        at ch.qos.logback.core.rolling.RollingFileAppender.subAppend(RollingFileAppender.java:175)
        at ch.qos.logback.core.OutputStreamAppender.append(OutputStreamAppender.java:103)
        at ch.qos.logback.core.UnsynchronizedAppenderBase.doAppend(UnsynchronizedAppenderBase.java:88)
        at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:48)
        at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:273)
        at ch.qos.logback.classic.Logger.callAppenders(Logger.java:260)
        at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:442)
        at ch.qos.logback.classic.Logger.filterAndLog_2(Logger.java:433)
        at ch.qos.logback.classic.Logger.trace(Logger.java:454)
        at com.datastax.driver.core.Connection$Dispatcher.messageReceived(Connection.java:558)
        at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:80)
        at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
        at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:783)
        at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:302)
        at org.jboss.netty.handler.codec.oneone.OneToOneDecoder.handleUpstream(OneToOneDecoder.java:76)
        at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
        at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:783)
        at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:302)
        at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:321)
        at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:299)
        at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:214)
        at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:80)
        at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
        at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
        at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:274)
        at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:261)
        at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:351)
        at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:282)
        at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:202)
        at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
        at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:44)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)

知道cassandra或slf4j的人是否可以帮助找出导致这些消息被打印的原因?我在开发环境中看不到这些消息。在生产环境中,它导致我的catalina.out填满和维护开销。

1 个答案:

答案 0 :(得分:2)

尝试删除项目中的target文件夹并重建它。某些类可能正在缓存。