-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Native build fails with java.lang.NoSuchMethodException: org.apache.kafka.common.security.authenticator.SaslClientCallbackHandler #2615
Comments
While we provided some hints to get a basic Spring for Apache Kafka application running as a native image, we (Spring) can't take on the responsibility of making all aspects of the You can add your own hints or reproduce the issue without Spring and raise an issue over there. If you get it working with your own hints, we'd consider accepting a PR, if you want to contribute it. |
I'd prefer to have Apache Kafka client-specific native hints exactly in Apache Kafka. |
I've got my Spring Kafka consumers compiling as native image. There is a core Java security hint needed in my case which I am narrowing down from the dump I got from the tracing agent. The kicker for me right now is the ErrorHandlingDeserializer, since it serializes exceptions into the header. I plan to implement a version that just stores the stack trace instead. |
The I suppose you could add that as a separate header and add code to the DLPR to get it from there, if present. Feel free to submit a PR with these changes. |
Ah interesting I see now. I'll take a look! |
I've got this working and we've been using it in production all year. I want to submit a PR but when I went to write the tests to submit the PR for spring-kafka, I realized it's not going to be simple. Can't try and fake-out the static variable that indicates whether we're running in native or not because of the way tests start up. I think I'll have to actually make the tests run in native. |
@matthenry87 What changes are we talking about here? Is this still about the original report ( |
My changes are the ones mentioned above that enable a consumer running native. They do include a hint for the original report, and we're even using IAM authentication with MSK. I'll have a look at those tests. |
If the hints are specifically for components outside of Spring Kafka, it might be better to add them in Oracle's graalvm-reachability-metadata repository. Take look here for example: https://github.com/oracle/graalvm-reachability-metadata/blob/master/metadata/org.apache.kafka/kafka-clients/3.5.1/reflect-config.json. |
In what version(s) of Spring for Apache Kafka are you seeing this issue?
spring-kafka:3.0.4
kafka-clients:3.3.2
Describe the bug
Tryied to create a native springboot with kafka using microsoft azure eventhub Kafka layer. That uses SASL PLAIN.
Run as docker image build with
mvn -DskipTests -Pnative,nativeTest spring-boot:build-image
Failure to create KafkaConsumer Caused by: org.apache.kafka.common.KafkaException: org.apache.kafka.common.KafkaException: Could not find a public no-argument constructor for org.apache.kafka.common.security.authenticator.SaslClientCallbackHandler
To Reproduce
Using the following application.properties:
Expected behavior
With the normal (non-native), the app runs normally.
Maybe related:
#2545
Stacktrace
The text was updated successfully, but these errors were encountered: