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

JDK 25 Support? #13375

Open
grcevski opened this issue Feb 21, 2025 · 2 comments
Open

JDK 25 Support? #13375

grcevski opened this issue Feb 21, 2025 · 2 comments
Labels
bug Something isn't working needs triage New issue that requires triage

Comments

@grcevski
Copy link

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

@grcevski grcevski added bug Something isn't working needs triage New issue that requires triage labels Feb 21, 2025
@trask
Copy link
Member

trask commented Feb 22, 2025

well, let's start with 24-ea 😄 #13376

@grcevski
Copy link
Author

well, let's start with 24-ea 😄 #13376

Thanks for the quick response @trask! I tested locally with the 24-rc1 and it works well, at least in my limited tests that I did for HTTP+Postgresql.

This is the 24 version I tried:

openjdk version "24" 2025-03-18
OpenJDK Runtime Environment (build 24+36-3646)
OpenJDK 64-Bit Server VM (build 24+36-3646, mixed mode, sharing)

I see the same message:

WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release

so I think it's maybe something else, or perhaps a JVM bug. I'll dig more into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage New issue that requires triage
Projects
None yet
Development

No branches or pull requests

2 participants