使用 slf4j.Marker 时出现 java.lang.IncompatibleClassChangeError。看来我在类路径中有几个 slf4j 版本。但是在执行 maven dependency:tree 时,它说只有 slf4j 1.7.25。你们有什么想法可能是什么问题吗?依赖关系如下:
- 回退 1.2.3
- slf4j 1.7.25
- logstash-logback-encoder 5.0
该应用程序部署在 WildFlly 8.2.1 AS 上。
> -ERROR in net.logstash.logback.appender.LogstashTcpSocketAppender[stash] - Unable to process event: Class net.logstash.logback.marker.ObjectAppendingMarker does not implement the requested interface org.slf4j.Marker java.lang.IncompatibleClassChangeError: Class net.logstash.logback.marker.ObjectAppendingMarker does not implement the requested interface org.slf4j.Marker
>
> 2018-03-31 00:17:03,287 INFO [stdout] (logback-appender-stash-127.0.0.1:4560-2) at java.lang.IncompatibleClassChangeError: Class net.logstash.logback.marker.ObjectAppendingMarker does not implement the requested interface org.slf4j.Marker
>
> 2018-03-31 00:17:03,287 INFO [stdout] (logback-appender-stash-127.0.0.1:4560-2) at at net.logstash.logback.composite.loggingevent.JsonMessageJsonProvider.writeTo(JsonMessageJsonProvider.java:52)
>
> 2018-03-31 00:17:03,287 INFO [stdout] (logback-appender-stash-127.0.0.1:4560-2) at at net.logstash.logback.composite.loggingevent.JsonMessageJsonProvider.writeTo(JsonMessageJsonProvider.java:31)
>
> 2018-03-31 00:17:03,287 INFO [stdout] (logback-appender-stash-127.0.0.1:4560-2) at at net.logstash.logback.composite.JsonProviders.writeTo(JsonProviders.java:77)
>
> 2018-03-31 00:17:03,287 INFO [stdout] (logback-appender-stash-127.0.0.1:4560-2) at at net.logstash.logback.composite.CompositeJsonFormatter.writeEventToGenerator(CompositeJsonFormatter.java:175)
>
> 2018-03-31 00:17:03,288 INFO [stdout] (logback-appender-stash-127.0.0.1:4560-2) at at net.logstash.logback.composite.CompositeJsonFormatter.writeEventToOutputStream(CompositeJsonFormatter.java:152)
>
> 2018-03-31 00:17:03,288 INFO [stdout] (logback-appender-stash-127.0.0.1:4560-2) at at net.logstash.logback.encoder.CompositeJsonEncoder.encode(CompositeJsonEncoder.java:114)
>
> 2018-03-31 00:17:03,288 INFO [stdout] (logback-appender-stash-127.0.0.1:4560-2) at at net.logstash.logback.encoder.CompositeJsonEncoder.encode(CompositeJsonEncoder.java:32)
>
> 2018-03-31 00:17:03,288 INFO [stdout] (logback-appender-stash-127.0.0.1:4560-2) at at net.logstash.logback.appender.AbstractLogstashTcpSocketAppender$TcpSendingEventHandler.onEvent(AbstractLogstashTcpSocketAppender.java:454)
>
> 2018-03-31 00:17:03,288 INFO [stdout] (logback-appender-stash-127.0.0.1:4560-2) at at net.logstash.logback.appender.AbstractLogstashTcpSocketAppender$TcpSendingEventHandler.onEvent(AbstractLogstashTcpSocketAppender.java:264)
>
> 2018-03-31 00:17:03,288 INFO [stdout] (logback-appender-stash-127.0.0.1:4560-2) at at net.logstash.logback.appender.AsyncDisruptorAppender$EventClearingEventHandler.onEvent(AsyncDisruptorAppender.java:330)
>
> 2018-03-31 00:17:03,288 INFO [stdout] (logback-appender-stash-127.0.0.1:4560-2) at at net.logstash.logback.appender.AsyncDisruptorAppender$EventClearingEventHandler.onEvent(AsyncDisruptorAppender.java:318)
>
> 2018-03-31 00:17:03,288 INFO [stdout] (logback-appender-stash-127.0.0.1:4560-2)