Error Produce Avro Records example in Confluent Cloud

I’m trying execute this command from this tutorial:

mvn exec:java -Dexec.mainClass="" -Dexec.args="$HOME/.confluent/java.config test2"

And return this error:

Caused by: org.apache.kafka.common.KafkaException: Failed to create new KafkaAdminClient
    at org.apache.kafka.clients.admin.KafkaAdminClient.createInternal (
    at org.apache.kafka.clients.admin.KafkaAdminClient.createInternal (
    at org.apache.kafka.clients.admin.Admin.create (
    at org.apache.kafka.clients.admin.AdminClient.create (
    at (
    at (
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (
    at java.lang.reflect.Method.invoke (
    at org.codehaus.mojo.exec.ExecJavaMojo$ (
    at (
Caused by: java.lang.IllegalArgumentException: Login module control flag not specified in JAAS config
    at (

Could you please advice how to solve this error?
Thanks in advance!

@davidleongz Welcome to the forum.

This exception is thrown when the Jaas configuration cannot be properly parsed (kafka source). I would double check the sasl.jaas.config value and ensure it follows this pattern including the spaces, quotes and semicolon. required username='<key>' password='secret';

Here is another example that configures Java Consumers for Confluent Cloud if you’d like to compare the examples for a potential issue / difference:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.