Skip to content

JDK 25 Support? #13375

@grcevski

Description

@grcevski

Describe the bug

Running the javaagent with SpringBoot 3 application on JDK 25 causes an error on start. I'm wondering if this is a known issue, looks like ByteBuddy related, or am I doing something wrong?

Here's the output I get when I try loading the agent:

/jdk-25/bin/java -javaagent:./opentelemetry-javaagent.jar -jar target/greeting-service-1.0.0-SNAPSHOT.jar
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
[otel.javaagent 2025-02-21 15:50:29:541 -0500] [main] INFO io.opentelemetry.javaagent.tooling.VersionLogger - opentelemetry-javaagent - version: 2.13.1
WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::objectFieldOffset has been called by net.bytebuddy.dynamic.loading.ClassInjector$UsingUnsafe$Dispatcher$CreationAction (file:/javatestserver/opentelemetry-javaagent.jar)
WARNING: Please consider reporting this to the maintainers of class net.bytebuddy.dynamic.loading.ClassInjector$UsingUnsafe$Dispatcher$CreationAction
WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v3.2.1)

Exception in thread "main" java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:119)
	at java.base/java.lang.reflect.Method.invoke(Method.java:565)
	at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:95)
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
	at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:65)
Caused by: java.lang.NoSuchFieldError: Class ch.qos.logback.classic.spi.LoggingEvent does not have member field 'java.lang.Object __opentelemetryVirtualField$ch$qos$logback$classic$spi$ILoggingEvent$io$opentelemetry$javaagent$shaded$io$opentelemetry$context$Context'
	at ch.qos.logback.classic.spi.LoggingEvent.__set__opentelemetryVirtualField$ch$qos$logback$classic$spi$ILoggingEvent$io$opentelemetry$javaagent$shaded$io$opentelemetry$context$Context(LoggingEvent.java)
	at io.opentelemetry.javaagent.bootstrap.field.VirtualFieldImpl$ch$qos$logback$classic$spi$ILoggingEvent$io$opentelemetry$javaagent$shaded$io$opentelemetry$context$Context.realPut(VirtualFieldImplementationsGenerator.java)
	at io.opentelemetry.javaagent.bootstrap.field.VirtualFieldImpl$ch$qos$logback$classic$spi$ILoggingEvent$io$opentelemetry$javaagent$shaded$io$opentelemetry$context$Context.set(VirtualFieldImplementationsGenerator.java:285)
	at ch.qos.logback.classic.Logger.callAppenders(Logger.java:257)
	at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:426)
	at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:386)
	at ch.qos.logback.classic.Logger.log(Logger.java:780)
	at org.apache.commons.logging.LogAdapter$Slf4jLocationAwareLog.error(LogAdapter.java:431)
	at org.springframework.boot.SpringApplication.reportFailure(SpringApplication.java:855)
	at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:819)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:347)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1358)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1347)
	at de.fstab.demo.greeting.Application.main(Application.java:14)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	... 5 more

/jdk-25/bin/java -version
openjdk version "25-ea" 2025-09-16
OpenJDK Runtime Environment (build 25-ea+11-1205)
OpenJDK 64-Bit Server VM (build 25-ea+11-1205, mixed mode, sharing)

Steps to reproduce

  1. Build any simple SpringBoot 3.x application, e.g. using the SpringBoot starter.
  2. Run OpenJDK 25 with the java instrumentation by loading the agent on the command line:
    /jdk-25/bin/java -javaagent:./opentelemetry-javaagent.jar -jar target/my-service-1.0.0-SNAPSHOT.jar

Expected behavior

The SpringBoot application should start and it should be instrumented.

Actual behavior

The SpringBoot application fails to start

Javaagent or library instrumentation version

v2.13.1

Environment

JDK: OpenJDK 25
openjdk version "25-ea" 2025-09-16
OpenJDK Runtime Environment (build 25-ea+11-1205)
OpenJDK 64-Bit Server VM (build 25-ea+11-1205, mixed mode, sharing)
OS:
Linux x86-64
6.8.0-40-generic #40-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 5 10:34:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds triageNew issue that requires triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions