尝试加入群集时节点失败

时间:2016-10-23 11:49:21

标签: playframework playframework-2.0 akka akka-monitoring kamon

我是前端和后端服务器。

前端运行Play! 2.5和akka 2.4.11 后端运行akka 2.4.11

两个都跑kamon 0.6.3, 并具有以下依赖项:

"io.kamon" %% "kamon-akka" % Version.kamon,
"io.kamon" %% "kamon-log-reporter" % Version.kamon,
"io.kamon" %% "kamon-system-metrics" % Version.kamon,
"io.kamon" %% "kamon-core" % Version.kamon,
"io.kamon" %% "kamon-akka-remote" % Version.kamon,
"io.kamon" %% "kamon-statsd" % Version.kamon,
"io.kamon" % "kamon-play-25_2.11" % Version.kamon

在build.sbt中我有以下内容:

aspectjSettings
javaOptions <++= AspectjKeys.weaverOptions in Aspectj
fork in run := true

我用aspectj weaver开始后端:

-javaagent:./aspectjweaver/aspectjweaver-1.8.9.jar

在plugins.sbt中,我添加了以下插件:

addSbtPlugin("io.kamon" % "aspectj-play-runner" % "0.1.3")

然而,当我开始后端和前端时,我在后端得到以下异常,因为我的前端节点加入了 后端集群。

java.lang.NoSuchFieldError: PARSER
    at akka.remote.instrumentation.TraceContextAwareWireFormats$TraceContextAwareRemoteEnvelope.<init>(TraceContextAwareWireFormats.java:859)
    at akka.remote.instrumentation.TraceContextAwareWireFormats$TraceContextAwareRemoteEnvelope.<init>(TraceContextAwareWireFormats.java:806)
    at akka.remote.instrumentation.TraceContextAwareWireFormats$TraceContextAwareRemoteEnvelope$1.parsePartialFrom(TraceContextAwareWireFormats.java:941)
    at akka.remote.instrumentation.TraceContextAwareWireFormats$TraceContextAwareRemoteEnvelope$1.parsePartialFrom(TraceContextAwareWireFormats.java:936)
    at com.google.protobuf.CodedInputStream.readMessage(CodedInputStream.java:309)
    at akka.remote.instrumentation.TraceContextAwareWireFormats$AckAndTraceContextAwareEnvelopeContainer.<init>(TraceContextAwareWireFormats.java:111)
    at akka.remote.instrumentation.TraceContextAwareWireFormats$AckAndTraceContextAwareEnvelopeContainer.<init>(TraceContextAwareWireFormats.java:45)
    at akka.remote.instrumentation.TraceContextAwareWireFormats$AckAndTraceContextAwareEnvelopeContainer$1.parsePartialFrom(TraceContextAwareWireFormats.java:149)
    at akka.remote.instrumentation.TraceContextAwareWireFormats$AckAndTraceContextAwareEnvelopeContainer$1.parsePartialFrom(TraceContextAwareWireFormats.java:144)
    at com.google.protobuf.AbstractParser.parsePartialFrom(AbstractParser.java:141)
    at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:176)
    at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:188)
    at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:193)
    at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:49)
    at akka.remote.instrumentation.TraceContextAwareWireFormats$AckAndTraceContextAwareEnvelopeContainer.parseFrom(TraceContextAwareWireFormats.java:279)
    at akka.kamon.instrumentation.RemotingInstrumentation.aroundDecodeRemoteMessage(RemotingInstrumentation.scala:82)
    at akka.remote.transport.AkkaPduProtobufCodec$.decodeMessage(AkkaPduCodec.scala:187)
    at akka.remote.EndpointReader.akka$remote$EndpointReader$$tryDecodeMessageAndAck(Endpoint.scala:1043)
    at akka.remote.EndpointReader$$anonfun$receive$2.applyOrElse(Endpoint.scala:974)
    at akka.actor.Actor$class.aroundReceive(Actor.scala:484)
    at akka.remote.EndpointActor.aroundReceive(Endpoint.scala:449)
    at akka.actor.ActorCell.receiveMessage(ActorCell.scala:526)
    at akka.actor.ActorCell.invoke_aroundBody0(ActorCell.scala:495)
    at akka.actor.ActorCell$AjcClosure1.run(ActorCell.scala:1)
    at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
    at akka.kamon.instrumentation.ActorMonitors$$anon$1$$anonfun$processMessage$1.apply(ActorMonitor.scala:59)
    at kamon.trace.Tracer$.withContext(TracerModule.scala:58)
    at akka.kamon.instrumentation.ActorMonitors$$anon$1.processMessage(ActorMonitor.scala:58)
    at akka.kamon.instrumentation.ActorCellInstrumentation.aroundBehaviourInvoke(ActorInstrumentation.scala:44)
    at akka.actor.ActorCell.invoke(ActorCell.scala:488)
    at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:257)
    at akka.dispatch.Mailbox.run(Mailbox.scala:224)
    at akka.dispatch.Mailbox.exec(Mailbox.scala:234)
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

你能帮忙吗?

1 个答案:

答案 0 :(得分:0)

答案很简单。应该使用

"io.kamon" % "kamon-akka-remote_akka-2.4_2.11" % "0.6.3"

代替。