GeezerVison is showing github.com — Whitelist JMH annotation processing in microbench module by laosijikaichele · Pull Request #16428 · netty/netty
Conversation
Motivation:
Starting from JDK 23, the annotation processing was disabled by default, see:
https://bugs.java.com/bugdatabase/JDK-8321314/description
https://mail.openjdk.org/pipermail/jdk-dev/2024-May/009028.html
This change breaks the microbench module because it relies on JMH annotation processors to generate benchmark code. For instance, when building with JDK 25, run the following command within the microbench module:
mvn clean install -Dcheckstyle.skip -Pbenchmark-jar
Then run the generated JAR(java -jar target/microbenchmarks.jar), and it results in the following error:
Error: Unable to access jarfile microbenchmarks.jar
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:98)
at org.openjdk.jmh.runner.BenchmarkList.find(BenchmarkList.java:124)
at org.openjdk.jmh.runner.Runner.internalRun(Runner.java:253)
at org.openjdk.jmh.runner.Runner.run(Runner.java:209)
at org.openjdk.jmh.Main.main(Main.java:71)
Modification:
Whitelist the jmh-generator-annprocess in the microbench/pom.xml, with annotationProcessorPaths configuration, see:
https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#annotationProcessorPaths
Result:
Properly process the JMH annotation.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
netty-project-bot
pushed a commit
that referenced
this pull request
Mar 9, 2026
Motivation:
Starting from JDK 23, the annotation processing was disabled by default,
see:
https://bugs.java.com/bugdatabase/JDK-8321314/description
https://mail.openjdk.org/pipermail/jdk-dev/2024-May/009028.html
This change breaks the `microbench` module because it relies on JMH
annotation processors to generate benchmark code. For instance, when
building with JDK 25, run the following command within the `microbench`
module:
> mvn clean install -Dcheckstyle.skip -Pbenchmark-jar
Then run the generated JAR(`java -jar target/microbenchmarks.jar`), and
it results in the following error:
> Error: Unable to access jarfile microbenchmarks.jar
> 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:98)
> at org.openjdk.jmh.runner.BenchmarkList.find(BenchmarkList.java:124)
> at org.openjdk.jmh.runner.Runner.internalRun(Runner.java:253)
> at org.openjdk.jmh.runner.Runner.run(Runner.java:209)
> at org.openjdk.jmh.Main.main(Main.java:71)
Modification:
Whitelist the `jmh-generator-annprocess` in the `microbench/pom.xml`,
with `annotationProcessorPaths` configuration, see:
https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#annotationProcessorPaths
Result:
Properly process the JMH annotation.
(cherry picked from commit 335d294)
netty-project-bot
pushed a commit
that referenced
this pull request
Mar 9, 2026
Motivation:
Starting from JDK 23, the annotation processing was disabled by default,
see:
https://bugs.java.com/bugdatabase/JDK-8321314/description
https://mail.openjdk.org/pipermail/jdk-dev/2024-May/009028.html
This change breaks the `microbench` module because it relies on JMH
annotation processors to generate benchmark code. For instance, when
building with JDK 25, run the following command within the `microbench`
module:
> mvn clean install -Dcheckstyle.skip -Pbenchmark-jar
Then run the generated JAR(`java -jar target/microbenchmarks.jar`), and
it results in the following error:
> Error: Unable to access jarfile microbenchmarks.jar
> 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:98)
> at org.openjdk.jmh.runner.BenchmarkList.find(BenchmarkList.java:124)
> at org.openjdk.jmh.runner.Runner.internalRun(Runner.java:253)
> at org.openjdk.jmh.runner.Runner.run(Runner.java:209)
> at org.openjdk.jmh.Main.main(Main.java:71)
Modification:
Whitelist the `jmh-generator-annprocess` in the `microbench/pom.xml`,
with `annotationProcessorPaths` configuration, see:
https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#annotationProcessorPaths
Result:
Properly process the JMH annotation.
(cherry picked from commit 335d294)
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Mar 9, 2026
chrisvest
pushed a commit
that referenced
this pull request
Mar 9, 2026
…le (#16430)
Auto-port of #16428 to 4.1
Cherry-picked commit: 335d294
---
Motivation:
Starting from JDK 23, the annotation processing was disabled by default,
see:
https://bugs.java.com/bugdatabase/JDK-8321314/description
https://mail.openjdk.org/pipermail/jdk-dev/2024-May/009028.html
This change breaks the `microbench` module because it relies on JMH
annotation processors to generate benchmark code. For instance, when
building with JDK 25, run the following command within the `microbench`
module:
> mvn clean install -Dcheckstyle.skip -Pbenchmark-jar
Then run the generated JAR(`java -jar target/microbenchmarks.jar`), and
it results in the following error:
> Error: Unable to access jarfile microbenchmarks.jar
> 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:98)
> at org.openjdk.jmh.runner.BenchmarkList.find(BenchmarkList.java:124)
> at org.openjdk.jmh.runner.Runner.internalRun(Runner.java:253)
> at org.openjdk.jmh.runner.Runner.run(Runner.java:209)
> at org.openjdk.jmh.Main.main(Main.java:71)
Modification:
Whitelist the `jmh-generator-annprocess` in the `microbench/pom.xml`,
with `annotationProcessorPaths` configuration, see:
https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#annotationProcessorPaths
Result:
Properly process the JMH annotation.
Co-authored-by: old driver <[email protected]>
chrisvest
pushed a commit
that referenced
this pull request
Mar 11, 2026
…le (#16429)
Auto-port of #16428 to 5.0
Cherry-picked commit: 335d294
---
Motivation:
Starting from JDK 23, the annotation processing was disabled by default,
see:
https://bugs.java.com/bugdatabase/JDK-8321314/description
https://mail.openjdk.org/pipermail/jdk-dev/2024-May/009028.html
This change breaks the `microbench` module because it relies on JMH
annotation processors to generate benchmark code. For instance, when
building with JDK 25, run the following command within the `microbench`
module:
> mvn clean install -Dcheckstyle.skip -Pbenchmark-jar
Then run the generated JAR(`java -jar target/microbenchmarks.jar`), and
it results in the following error:
> Error: Unable to access jarfile microbenchmarks.jar
> 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:98)
> at org.openjdk.jmh.runner.BenchmarkList.find(BenchmarkList.java:124)
> at org.openjdk.jmh.runner.Runner.internalRun(Runner.java:253)
> at org.openjdk.jmh.runner.Runner.run(Runner.java:209)
> at org.openjdk.jmh.Main.main(Main.java:71)
Modification:
Whitelist the `jmh-generator-annprocess` in the `microbench/pom.xml`,
with `annotationProcessorPaths` configuration, see:
https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#annotationProcessorPaths
Result:
Properly process the JMH annotation.
Co-authored-by: old driver <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|