Skip to content
This repository has been archived by the owner on Mar 29, 2020. It is now read-only.

NoSuchMethodError in ZipkinReporter.convertSpan in Play2.8 app #14

Closed
Cereopsis opened this issue Feb 15, 2020 · 2 comments
Closed

NoSuchMethodError in ZipkinReporter.convertSpan in Play2.8 app #14

Cereopsis opened this issue Feb 15, 2020 · 2 comments

Comments

@Cereopsis
Copy link

Setup

java version "1.8.0_221"
Java(TM) SE Runtime Environment (build 1.8.0_221-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.221-b11, mixed mode)

sbt new playframework/play-scala-seed.g8 --name=play-zipkin-2.8
cd play-zipkin-2.8

Append the following toproject/plugins.sbt:

addSbtPlugin("io.kamon" % "sbt-kanela-runner-play-2.8" % "2.0.6")
addSbtPlugin("com.lightbend.sbt" % "sbt-javaagent" % "0.1.5")

build.sbt:

lazy val root = (project in file("."))
  .enablePlugins(PlayScala, JavaAgent)
  .settings(
    scalaVersion := "2.13.1",
    javaAgents += "io.kamon" % "kanela-agent" % "1.0.3",
    libraryDependencies	++= Seq(
      guice,
      "io.kamon"   %% "kamon-bundle"  % "2.0.6",
      "io.kamon"   %% "kamon-zipkin"  % "2.0.1"
    )
  )

Optional: Run a basic Zipkin service

docker run -d -p 9411:9411 openzipkin/zipkin-slim

Build & run

sbt clean playUpdateSecret universal:packageZipTarball
cd target/universal
tar xzf play-zipkin-2.8.tgz
cd play-zipkin-2.8
bin/play-zipkin-2.8

Run some load

$> for i in {1..100}; do curl localhost:9000/ ;done

At some point you will see the following stack trace appear in the terminal

[error] k.m.ModuleRegistry - Reporter [Zipkin Reporter] failed to process a spans tick.
java.lang.NoSuchMethodError: java.lang.Math.floorDiv(JI)J
	at kamon.zipkin.ZipkinReporter.convertSpan(ZipkinReporter.scala:60)
	at kamon.zipkin.ZipkinReporter.$anonfun$reportSpans$1(ZipkinReporter.scala:57)
	at scala.collection.immutable.List.map(List.scala:219)
	at scala.collection.immutable.List.map(List.scala:79)
	at kamon.zipkin.ZipkinReporter.reportSpans(ZipkinReporter.scala:57)
	at kamon.module.ModuleRegistry$$anon$2.$anonfun$run$4(ModuleRegistry.scala:214)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
	at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:661)
	at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:430)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

Probing a little in sbt console, there is no such problem with doing pretty much exactly what ZipkinReporter.convertSpan appears to be doing.

@jatcwang
Copy link

We're not using Play and we're getting the same issue. Running the app with JDK 11 (openjdk:11 as the base docker image) seems to fix the issue..

cspinetta added a commit to cspinetta/kamon-zipkin that referenced this issue Mar 24, 2020
dpsoft pushed a commit that referenced this issue Mar 24, 2020
* fixes issue #14 and upgrade to Scala 2.12.11
* upgrade minor versions of zipkin dependencies
@dpsoft
Copy link
Contributor

dpsoft commented Mar 29, 2020

Fixed with #15

@dpsoft dpsoft closed this as completed Mar 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants