Я пытаюсь использовать этот scala плагин микробенчмарка, sbt-jmh, и получаю сообщение об ошибке.
package play.twirl.benchmarks
import play.twirl.parser._
import play.twirl.parser.TreeNodes._
import org.openjdk.jmh.annotations.Benchmark
class TwirlBenchmark {
@Benchmark
def simpleParse(): Template = {
val parser = new TwirlParser(false)
val template = "<h1>hello</h1>@someVar"
parser.parse(template) match {
case parser.Success(tmpl, input) =>
if (!input.atEnd) sys.error("Template parsed but not at source end")
tmpl
case parser.Error(_, _, errors) =>
sys.error("Template failed to parse: " + errors.head.str)
}
}
}
Он компилируется нормально, но при запуске теста:
JMH: запустить
Я получаю эти ошибки:
[info] # Warmup Iteration 1: <failure>
[info] java.lang.NoClassDefFoundError: scala/util/parsing/input/Position
[info] at play.twirl.benchmarks.TwirlBenchmark.simpleParse(TwirlBenchmarks.scala:23)
[info] at play.twirl.benchmarks.generated.TwirlBenchmark_simpleParse_jmhTest.simpleParse_thrpt_jmhStub(TwirlBenchmark_simpleParse_jmhTest.java:119)
[info] at play.twirl.benchmarks.generated.TwirlBenchmark_simpleParse_jmhTest.simpleParse_Throughput(TwirlBenchmark_simpleParse_jmhTest.java:83)
[info] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[info] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[info] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[info] at java.lang.reflect.Method.invoke(Method.java:498)
[info] at org.openjdk.jmh.runner.BenchmarkHandler$BenchmarkTask.call(BenchmarkHandler.java:453)
[info] at org.openjdk.jmh.runner.BenchmarkHandler$BenchmarkTask.call(BenchmarkHandler.java:437)
[info] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[info] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[info] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[info] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[info] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[info] at java.lang.Thread.run(Thread.java:745)
[info] Caused by: java.lang.ClassNotFoundException: scala.util.parsing.input.Position
[info] at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
[info] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[info] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
[info] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[info] ... 15 more
[info] # Run complete. Total time: 00:00:02
Не знаю, как действовать. Помощь