question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Scala: Unable to find the resource: /META-INF/BenchmarkList

See original GitHub issue

idea ultimate 14.1.2 + scala plugin 1.4.15 + jmh plugin 1.0.1

I have an sbt project opened in IDEA. When I run one benchmark method or all methods in a class I get this error:

Exception in thread "main" java.lang.RuntimeException: ERROR: Unable to find the resource: /META-INF/BenchmarkList
    at org.openjdk.jmh.runner.AbstractResourceReader.getReaders(AbstractResourceReader.java:96)
    at org.openjdk.jmh.runner.BenchmarkList.find(BenchmarkList.java:104)
    at org.openjdk.jmh.runner.Runner.internalRun(Runner.java:250)
    at org.openjdk.jmh.runner.Runner.run(Runner.java:202)
    at org.openjdk.jmh.Main.main(Main.java:69)

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:21
  • Comments:23 (3 by maintainers)

github_iconTop GitHub Comments

54reactions
artyushovcommented, Apr 23, 2015

Hi!

Do you have org.openjdk.jmh:jmh-generator-annprocess on your classpath? If yes, is annotation processing enabled in your IDE? You can find the checkbox under Preferences -> Build, Execution, Deployment -> Compiler -> Annotation Processors

11reactions
metamakercommented, Sep 6, 2020

The solution for me was to use testAnnotationProcessor in Gradle 6 build.gradle:

	testImplementation 'org.openjdk.jmh:jmh-core:1.25'
	testAnnotationProcessor 'org.openjdk.jmh:jmh-generator-annprocess:1.25'

instead of

	testImplementation 'org.openjdk.jmh:jmh-core:1.25'
	testImplementation 'org.openjdk.jmh:jmh-generator-annprocess:1.25'

Mind that my setup is a bit non-standard - I run JMH from JUnit. Still, this solved missing BenchmarkList problem.

Also I don’t use jmh-gradle-plugin, only those two dependencies from above are enough to integrate JMH to JUnit.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JMH Unable to find the resource: /META-INF/BenchmarkList
Finally found it out. There was a problem with missing exec-maven-plugin plugin <plugin> <groupId>org.codehaus.mojo</groupId> ...
Read more >
ktoso/sbt-jmh - Gitter
I am trying to run jmh Runner from a Main but I am getting the following error: ERROR: Unable to find the resource:...
Read more >
Unable to find the resource: /META-INF/BenchmarkList - Eclipse
Exception in thread "main" java.lang.RuntimeException: ERROR: Unable to find the resource: /META-INF/BenchmarkList at org.openjdk.jmh.runner ...
Read more >
Annotation processor is not picked up any more after module ...
Annotation processor is not picked up any more after module-info. java is added : IDEA-278667.
Read more >
ERROR: Unable to find the resource: /META-INF/BenchmarkList
ERROR: Unable to find the resource: /META-INF/BenchmarkList. 我是想着用benchmark 测试项目的。使用的是jmh,gradle 做为构建工具。在run 的时候,报 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found