APM Agent language and version:
APM java agent. Latest stable version (co.elastic.apm:elastic-apm-agent:1.52.1)
Description of the problem including expected versus actual behavior. Please include screenshots (if relevant):
Latest version of the apm-javalin-plugin is built using javalin version 4.2.0. As you can see here https://javalin.io/migration-guide-javalin-4-to-5
, version 5 has introduced some incompatibilities. For example, io.javalin.http.Context has been transformed to interface. As a result we can't use apm java agent in projects with new versions of javalin.
Is there any plans to update javalin version in apm-javalin-plugin? May I create a pull requests and try to fix this?
Steps to reproduce:
- create simple javalin project using javalin version 5.x.x or higher
- setup apm java agent using -javaagent flag
- java.lang.IncompatibleClassChangeError in logs
Provide logs and/or server output (if relevant):
java.lang.IncompatibleClassChangeError: Found interface io.javalin.http.Context, but class was expected
at co.elastic.apm.agent.javalin.JavalinInstrumentation$HandlerAdapterAdvice.setSpanAndTransactionName(JavalinInstrumentation.java:177) ~[elastic-apm-agent.jar:1.52.1]
at xx.xxxxx.xxxxxx.xxxxxxx.xxxxx.TestFilter.handle(TestFilter.java:40) ~[test-1.0.0-SNAPSHOT.jar:?]
at io.javalin.router.Endpoint.handle(Endpoint.kt:52) ~[javalin-6.1.3.jar:6.1.3]
at io.javalin.router.ParsedEndpoint.handle(ParsedEndpoint.kt:15) ~[javalin-6.1.3.jar:6.1.3]