I tried upgrading our Java APM agent to version 1.18, but are getting a ton of error messages when booting up.
The application is running in docker using image adoptopenjdk/openjdk11-openj9:jdk-11.0.1.13-alpine-slim.
Are there any additional steps i need to take when upgrading the application? Application is a Spring Boot application written in Kotlin using version 2.2.5.
java.lang.IllegalAccessError: Module 'java.base' no access to: package 'java.lang' because module 'java.base' can't read module 'unnamed module @61b4e073'
at java.base/java.lang.invoke.MethodHandle.sendResolveMethodHandle(MethodHandle.java:1237)
at java.base/java.lang.invoke.MethodHandle.getCPMethodHandleAt(Native Method)
at java.base/java.lang.invoke.MethodHandle.resolveInvokeDynamic(MethodHandle.java:1070)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:556)
at co.elastic.apm.agent.profiler.SamplingProfiler.run(SamplingProfiler.java:342)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:836)
Caused by: java.lang.IllegalAccessException: Module 'java.base' no access to: package 'java.lang' because module 'java.base' can't read module 'unnamed module @61b4e073'
at java.base/java.lang.invoke.MethodHandles$Lookup.throwIllegalAccessException(MethodHandles.java:730)
at java.base/java.lang.invoke.MethodHandles$Lookup.checkClassModuleVisibility(MethodHandles.java:711)
at java.base/java.lang.invoke.MethodHandles$Lookup.checkClassAccess(MethodHandles.java:487)
at java.base/java.lang.invoke.MethodHandles$Lookup.checkAccess(MethodHandles.java:392)
at java.base/java.lang.invoke.MethodHandles$Lookup.checkAccess(MethodHandles.java:341)
at java.base/java.lang.invoke.MethodHandles$Lookup.findStatic(MethodHandles.java:621)
at java.base/java.lang.invoke.MethodHandle.sendResolveMethodHandle(MethodHandle.java:1212)
... 10 more
The 1.18.0 version has a new way to instrument code, thus this seems to be an unexpected side effect.
Could you provide the JVM arguments that you are using to start the application ?
It looks like you are using java modules, thus it would help us reproduce and fix the issue.
@joames what version did you upgrade from? Can you confirm this problem does not occur when using agent version 1.17.0?
Also, if your application is compatible for that, can you test agent version 1.18.0 with Java 10?
Building with docker image openjdk:10 and running with docker image adoptopenjdk/openjdk10:jdk-10.0.2.13-alpine-slim gives me a warning at start up.
unable to instantiate 'co.elastic.apm.agent.httpclient.HttpClientInstrumentation', unsupported class version error: co/elastic/apm/agent/httpclient/HttpClientInstrumentation has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 54.0
This warning is expected, as this plugin only works with Java11 and later, you can ignore it (and we fixed the proper log level to avoid it by default).
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.