-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
I use the native-image-agent to generate the metadata to resources/META-INF/native-image folder, then compile the spring boot project to native image with the META-INF/native-image folder , there is an error when running. But if I do not use the META-INF/native-image folder, instead use the SpringBoot's HitConfig to add some metadata, the issue will not reproduce.
java.lang.UnsatisfiedLinkError: jdk.jfr.internal.JVM.getHandler(Ljava/lang/Class;)Ljava/lang/Object; [symbol: Java_jdk_jfr_internal_JVM_getHandler or Java_jdk_jfr_internal_JVM_getHandler__Ljava_lang_Class_2]
at org.graalvm.nativeimage.builder/com.oracle.svm.core.jni.access.JNINativeLinkage.getOrFindEntryPoint(JNINativeLinkage.java:152) ~[na:na]
at org.graalvm.nativeimage.builder/com.oracle.svm.core.jni.JNIGeneratedMethodSupport.nativeCallAddress(JNIGeneratedMethodSupport.java:53) ~[na:na]
at jdk.jfr@17.0.10/jdk.jfr.internal.JVM.getHandler(Native Method) ~[na:na]
at jdk.jfr@17.0.10/jdk.jfr.internal.Utils.getHandler(Utils.java:449) ~[na:na]
at jdk.jfr@17.0.10/jdk.jfr.internal.MetadataRepository.getHandler(MetadataRepository.java:174) ~[na:na]
at jdk.jfr@17.0.10/jdk.jfr.internal.MetadataRepository.register(MetadataRepository.java:135) ~[na:na]
at jdk.jfr@17.0.10/jdk.jfr.internal.MetadataRepository.register(MetadataRepository.java:130) ~[na:na]
at jdk.jfr@17.0.10/jdk.jfr.FlightRecorder.register(FlightRecorder.java:136) ~[na:na]
at io.lettuce.core.event.connection.JfrConnectionCreatedEvent.<clinit>(JfrConnectionCreatedEvent.java) ~[auth-service:6.3.1.RELEASE/12e6995]
at java.base@17.0.10/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[auth-service:na]
at java.base@17.0.10/java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[auth-service:na]
at io.lettuce.core.event.jfr.JfrEventRecorder.createEvent(JfrEventRecorder.java:108) ~[na:na]
at io.lettuce.core.event.jfr.JfrEventRecorder.record(JfrEventRecorder.java:48) ~[na:na]
at io.lettuce.core.AbstractRedisClient.initializeChannelAsync(AbstractRedisClient.java:398) ~[auth-service:6.3.1.RELEASE/12e6995]
at io.lettuce.core.RedisClient.connectStatefulAsync(RedisClient.java:324) ~[auth-service:6.3.1.RELEASE/12e6995]
at io.lettuce.core.RedisClient.connectStandaloneAsync(RedisClient.java:286) ~[auth-service:6.3.1.RELEASE/12e6995]
at io.lettuce.core.RedisClient.connect(RedisClient.java:215) ~[auth-service:6.3.1.RELEASE/12e6995]
at org.springframework.data.redis.connection.lettuce.StandaloneConnectionProvider.lambda$getConnection$1(StandaloneConnectionProvider.java:112) ~[auth-service:3.2.3]
at java.base@17.0.10/java.util.Optional.orElseGet(Optional.java:364) ~[auth-service:na]
at org.springframework.data.redis.connection.lettuce.StandaloneConnectionProvider.getConnection(StandaloneConnectionProvider.java:112) ~[auth-service:3.2.3]
at org.springframework.data.redis.connection.lettuce.LettucePoolingConnectionProvider.lambda$getConnection$0(LettucePoolingConnectionProvider.java:93) ~[na:na]
at io.lettuce.core.support.ConnectionPoolSupport$RedisPooledObjectFactory.create(ConnectionPoolSupport.java:211) ~[na:na]
at io.lettuce.core.support.ConnectionPoolSupport$RedisPooledObjectFactory.create(ConnectionPoolSupport.java:201) ~[na:na]
at org.apache.commons.pool2.BasePooledObjectFactory.makeObject(BasePooledObjectFactory.java:71) ~[auth-service:2.12.0]
at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:566) ~[auth-service:2.12.0]
at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:306) ~[auth-service:2.12.0]
at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:233) ~[auth-service:2.12.0]
at io.lettuce.core.support.ConnectionPoolSupport$1.borrowObject(ConnectionPoolSupport.java:122) ~[auth-service:6.3.1.RELEASE/12e6995]
at io.lettuce.core.support.ConnectionPoolSupport$1.borrowObject(ConnectionPoolSupport.java:117) ~[auth-service:6.3.1.RELEASE/12e6995]
at org.springframework.data.redis.connection.lettuce.LettucePoolingConnectionProvider.getConnection(LettucePoolingConnectionProvider.java:99) ~[na:na]
at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$ExceptionTranslatingConnectionProvider.getConnection(LettuceConnectionFactory.java:1724) ~[na:na]
at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$SharedConnection.getNativeConnection(LettuceConnectionFactory.java:1528) ~[auth-service:3.2.3]
at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$SharedConnection.lambda$getConnection$0(LettuceConnectionFactory.java:1508) ~[auth-service:3.2.3]
at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.doInLock(LettuceConnectionFactory.java:1469) ~[auth-service:3.2.3]
at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$SharedConnection.getConnection(LettuceConnectionFactory.java:1505) ~[auth-service:3.2.3]
at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.getSharedConnection(LettuceConnectionFactory.java:1191) ~[auth-service:3.2.3]
at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.getConnection(LettuceConnectionFactory.java:997) ~[auth-service:3.2.3]
at org.springframework.data.redis.core.RedisConnectionUtils.fetchConnection(RedisConnectionUtils.java:194) ~[na:na]
at org.springframework.data.redis.core.RedisConnectionUtils.doGetConnection(RedisConnectionUtils.java:143) ~[na:na]
at org.springframework.data.redis.core.RedisConnectionUtils.getConnection(RedisConnectionUtils.java:104) ~[na:na]
at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:383) ~[auth-service:3.2.3]
at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:363) ~[auth-service:3.2.3]
at org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:97) ~[auth-service:3.2.3]
at org.springframework.data.redis.core.DefaultHashOperations.get(DefaultHashOperations.java:51) ~[auth-service:3.2.3]
at xxxxxx
at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173) ~[auth-service:4.1.107.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166) ~[auth-service:4.1.107.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) ~[auth-service:4.1.107.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569) ~[na:na]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[na:na]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[na:na]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[na:na]
at java.base@17.0.10/java.lang.Thread.run(Thread.java:842) ~[auth-service:na]
at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:807) ~[auth-service:na]
at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:210) ~[na:na]
Enviroment
-GraalVM:
java version "17.0.10" 2024-01-16 LTS
Java(TM) SE Runtime Environment Oracle GraalVM 17.0.10+11.1 (build 17.0.10+11-LTS-jvmci-23.0-b27)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 17.0.10+11.1 (build 17.0.10+11-LTS-jvmci-23.0-b27, mixed mode, sharing)
-OS:
Distributor ID: Ubuntu
Description: Ubuntu 18.04.6 LTS
Release: 18.04
Codename: bionic
-Architecture:
Linux Dev 5.4.0-150-generic #167~18.04.1-Ubuntu SMP Wed May 24 00:51:42 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
maven dependents:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.3</version>
</parent>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.107.Final</version>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>5.1.2</version>
</dependency>
<dependency>
<groupId>io.lettuce</groupId>
<artifactId>lettuce-core</artifactId>
<version>6.3.1.RELEASE</version>
</dependency>