Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugins written for Java 9+ will fail compilation with "checking for wrong usages of ESLogger..." #52408

Closed
dweiss opened this issue Feb 17, 2020 · 2 comments
Labels
:Core/Infra/Plugins Plugin API and infrastructure Team:Core/Infra Meta label for core/infra team

Comments

@dweiss
Copy link
Contributor

dweiss commented Feb 17, 2020

ES 7.6.0:

> Task :loggerUsageCheck FAILED
| Output for C:\Tools\java\jdk13\bin\java.exe:checking for wrong usages of ESLogger...
| Exception in thread "main" java.lang.IllegalArgumentException
|       at org.objectweb.asm.ClassReader.<init>(ClassReader.java:170)
|       at org.objectweb.asm.ClassReader.<init>(ClassReader.java:153)
|       at org.objectweb.asm.ClassReader.<init>(ClassReader.java:424)
|       at org.elasticsearch.test.loggerusage.ESLoggerUsageChecker.check(ESLoggerUsageChecker.java:125)
|       at org.elasticsearch.test.loggerusage.ESLoggerUsageChecker.check(ESLoggerUsageChecker.java:119)
|       at org.elasticsearch.test.loggerusage.ESLoggerUsageChecker$1.visitFile(ESLoggerUsageChecker.java:109)
|       at org.elasticsearch.test.loggerusage.ESLoggerUsageChecker$1.visitFile(ESLoggerUsageChecker.java:104)
|       at java.base/java.nio.file.Files.walkFileTree(Files.java:2803)
|       at java.base/java.nio.file.Files.walkFileTree(Files.java:2875)
|       at org.elasticsearch.test.loggerusage.ESLoggerUsageChecker.checkLoggerUsage(ESLoggerUsageChecker.java:104)
|       at org.elasticsearch.test.loggerusage.ESLoggerUsageChecker.main(ESLoggerUsageChecker.java:86)

The plugin requires Java 11; the asm library can't parse the bytecode though (even though ES itself requires Java 13).

Workaround:

// logger check does not run on jdk 11 bytecode.
loggerUsageCheck.enabled = false
@romseygeek romseygeek added the :Core/Infra/Plugins Plugin API and infrastructure label Feb 17, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Plugins)

rjernst added a commit that referenced this issue Mar 17, 2020
The logger usage check uses its own version of ASM to inspect class
files for logging usages. Master was updated to support java 11
compilation in #40754. However, 7.x still used ASM 5, which could not
read newer java bytecode versions. This commit bumps ASM in 7.x used in
the logger usage check.

closes #52408
rjernst added a commit that referenced this issue Mar 17, 2020
The logger usage check uses its own version of ASM to inspect class
files for logging usages. Master was updated to support java 11
compilation in #40754. However, 7.x still used ASM 5, which could not
read newer java bytecode versions. This commit bumps ASM in 7.x used in
the logger usage check.

closes #52408
@rjernst rjernst added the Team:Core/Infra Meta label for core/infra team label May 4, 2020
@rjernst rjernst added the needs:triage Requires assignment of a team area label label Dec 3, 2020
@williamrandolph
Copy link
Contributor

As far as I can tell, this doesn't reproduce anymore and was fixed by #52742. I'm going to close, but if I'm wrong please reopen with a reproduction line.

@williamrandolph williamrandolph removed the needs:triage Requires assignment of a team area label label Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Plugins Plugin API and infrastructure Team:Core/Infra Meta label for core/infra team
Projects
None yet
Development

No branches or pull requests

5 participants