-
Notifications
You must be signed in to change notification settings - Fork 1.3k
AOT/GraalVM/native Caused by: java.lang.RuntimeException: No deserializer found in 'co.elastic.clients.elasticsearch.indices.IndexSettings._DESERIALIZER' #2565
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
Comments
Please provide a buildable/runnable example that produces this error. |
Of course, here we go. Step to reproduce: Step 1: download the issue.zip and decompress it. Step 2: build a native image, using the result of step 2 should be a native image named issue Step 3: run the native image with Step 4: can you please confirm you got the same stacktrace: |
|
Do I need to provide anything else? |
Patience. I will have a look at this. |
I cannot reproduce this with the provided code. non-native
native╰─➤ ./target/issue 1 ↵
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v3.1.0-RC2)
2023-05-20T14:45:31.700+02:00 INFO 60131 --- [ main] org.example.SomeApplication : Starting AOT-processed SomeApplication using Java 17.0.7 with PID 60131 (/Users/peter/Entwicklung/Projekte/3rdparty/issue/target/issue started by peter in /Users/peter/Entwicklung/Projekte/3rdparty/issue)
2023-05-20T14:45:31.700+02:00 INFO 60131 --- [ main] org.example.SomeApplication : No active profile set, falling back to 1 default profile: "default"
2023-05-20T14:45:31.776+02:00 INFO 60131 --- [ main] o.s.b.web.embedded.netty.NettyWebServer : Netty started on port 8080
2023-05-20T14:45:31.776+02:00 INFO 60131 --- [ main] org.example.SomeApplication : Started SomeApplication in 0.088 seconds (process running for 0.1)
2023-05-20T14:45:35.785+02:00 ERROR 60131 --- [ parallel-2] reactor.core.publisher.Operators : Operator called default onErrorDropped
reactor.core.Exceptions$ErrorCallbackNotImplemented: reactor.core.Exceptions$OverflowException: Could not emit buffer due to lack of requests
Caused by: reactor.core.Exceptions$OverflowException: Could not emit buffer due to lack of requests
at reactor.core.Exceptions.failWithOverflow(Exceptions.java:249) ~[na:na]
at reactor.core.publisher.FluxBufferTimeout$BufferTimeoutSubscriber.flushCallback(FluxBufferTimeout.java:227) ~[issue:3.5.5]
at reactor.core.publisher.FluxBufferTimeout$BufferTimeoutSubscriber.lambda$new$0(FluxBufferTimeout.java:158) ~[issue:3.5.5]
at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:84) ~[issue:3.5.5]
at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:37) ~[issue:3.5.5]
at [email protected]/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[issue:na]
at [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[na:na]
at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[issue:na]
at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[na:na]
at [email protected]/java.lang.Thread.run(Thread.java:833) ~[issue:na]
at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775) ~[issue:na]
at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203) ~[na:na]
|
Thanks for looking, I wasn't rushing anything. With that said, this is quite interesting. I managed to reproduce this on Linux, Windows and Mac, so probably not OS related issue. May I ask which version of GraalVM and maven command are you using? |
During the day, I shared this code with several colleagues and they were able to reproduce it. Still looking for someone who is not able to reproduce to see what are the differences |
22.3.2.r17-nik, and |
We were 6 to try with this java:
And could reproduce, let me try with you GraalVM and get back |
And also, if I may ask, are you compiling with or without this maven block?
|
I am using the pom.xml from your project, the only change I did is adding basic auth to the configuration because my Elasticsearch instance needs that. |
I now found the reason wjy I didn't observe the error: It's happening on index creation, and I had the program run first non-native and that created the index without problems, the later native executions did not need to create the index. When deleting the index from Elasticsearch. Will have a look later this week. |
many thanks |
I could reproduce this with imperative code as well. The problem is that the Elasticsearch libraries do not provide AOT runtime hints. I will try to get as many as needed and add them to Spring Data Elasticsearch (see #2575). For your problem, I got it running by adding two runtime hints: ElasticsearchClientRuntimeHints.java: package org.example;
import co.elastic.clients.elasticsearch._types.mapping.TypeMapping;
import co.elastic.clients.elasticsearch.indices.IndexSettings;
import org.springframework.aot.hint.*;
public class ElasticsearchClientRuntimeHints implements RuntimeHintsRegistrar {
@Override
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
hints.reflection()
.registerType(TypeReference.of(IndexSettings.class), builder -> builder.withField("_DESERIALIZER"))
.registerType(TypeReference.of(TypeMapping.class), builder -> builder.withField("_DESERIALIZER"));
}
} SomeAppplication.java: package org.example;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ImportRuntimeHints;
@SpringBootApplication
@ImportRuntimeHints(ElasticsearchClientRuntimeHints.class) // <=== this is new
public class SomeApplication {
public static void main(final String[] args) {
SpringApplication.run(SomeApplication.class);
}
} If you come across more missing things, add them to the runtime hints, check the current Spring Boot documentation about this topic. |
thank you! |
Hello team,
I would like to report an issue only faced with native / graalVM / AOT.
Using SpringBoot 3.1.0-RC2, (did not try with lower versions) I am able to reproduce this 100%
Could you please help on this issue?
Thank you
The text was updated successfully, but these errors were encountered: