ARTICLE AD BOX
I have been observing a weird issue in my application. Recently we started observing a lot of exceptions of this type in our logs:
IllegalArgumentException: Name for argument of type [java.lang.Long] not specified, and parameter name information not available via reflection. Ensure that the compiler uses the '-parameters' flag.
The -parameters compiler option is already being passed (checked in Gradle debug logs, it's probably from the Spring Boot plugin) and when I run javap to inspect the compiled class, I can see the MethodParameters metadata section with the correct method arguments.
Also, this issue seems to occur intermittently (as observed in Datadog). As in calls succeed sometimes and fail other times, even for the same methods.
We use pinned version numbers for Spring (3.3.13) and it's dependencies so it's unlikely that this is some change in the Spring version. Also this was changed a long time back, so should not be the root cause.
This leaves me with two theories:
A bug in the JVM. We use OpenJDK version 17.0.15+6-alpine-r0 although I can't find any open issues for this version.
The Datadog javaagent we use for instrumentation is somehow messing with the MethodParameters metadata of the controller classes.
In either case I am not sure how to investigate. Is there any way to get debug logs or introspect the behaviour of java agents?
