Cp-docker-images: Kafka-Connect ConnectDistributed main class not found

Created on 25 Jul 2019  路  2Comments  路  Source: confluentinc/cp-docker-images

When starting cp-kafka-connect:5.2.2 & 5.3.0 it stops with the followings error message:

===> Launching kafka-connect ...
Error: Could not find or load main class org.apache.kafka.connect.cli.ConnectDistributed

Zookeeper, Kafka and Schema Registry are working fine without any problems, only Kafka-Connect cannot start.

My configuration is:

docker create \
    --hostname kafka-connect.***.*** \
    --name kafka-connect.***.*** \
    --network w*** \
    --user 3000 \
    -e CONNECT_BOOTSTRAP_SERVERS=kafka.***.***:9092 \
    -e CONNECT_REST_PORT=8080 \
    -e CONNECT_GROUP_ID=kafka-connect \
    -e CONNECT_CONFIG_STORAGE_TOPIC=kafka-connect-config \
    -e CONNECT_OFFSET_STORAGE_TOPIC=kafka-connect-offsets \
    -e CONNECT_STATUS_STORAGE_TOPIC=kafka-connect-status \
    -e CONNECT_CONFIG_STORAGE_REPLICATION_FACTOR=1 \
    -e CONNECT_OFFSET_STORAGE_REPLICATION_FACTOR=1 \
    -e CONNECT_STATUS_STORAGE_REPLICATION_FACTOR=1 \
    -e CONNECT_CONFLUENT_TOPIC_REPLICATION_FACTOR=1 \
    -e CONNECT_KEY_CONVERTER=io.confluent.connect.avro.AvroConverter \
    -e CONNECT_VALUE_CONVERTER=io.confluent.connect.avro.AvroConverter \
    -e CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL=http://schema-registry.***.**:9181 \
    -e CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_URL=http://schema-registry.***.***:9181 \
    -e CONNECT_INTERNAL_KEY_CONVERTER=org.apache.kafka.connect.json.JsonConverter \
    -e CONNECT_INTERNAL_VALUE_CONVERTER=org.apache.kafka.connect.json.JsonConverter \
    -e CONNECT_REST_ADVERTISED_HOST_NAME=kafka-connect.***.*** \
    -e CONNECT_LOG4J_ROOT_LOGLEVEL=TRACE \
    -e CONNECT_PLUGIN_PATH=/usr/share/java \
    -v /mnt/***/kafka-connect:/usr/share/java \
    confluentinc/cp-kafka-connect:5.2.2

Most helpful comment

I would suggest you remove -v /mnt/***/kafka-connect:/usr/share/java \ or mount to a subfolder under /usr/share/java.

Otherwise, you've replaced the entire /usr/share/java path where the main class exists.

All 2 comments

I would suggest you remove -v /mnt/***/kafka-connect:/usr/share/java \ or mount to a subfolder under /usr/share/java.

Otherwise, you've replaced the entire /usr/share/java path where the main class exists.

You are right! I misread the example in the Confluent docs. I have changed it to:

    -e CONNECT_PLUGIN_PATH=/usr/share/java,/etc/kafka-connect/jars \
    -v /mnt/***/kafka-connect:/etc/kafka-connect/jars \

and now it works.

Many thanks for the quick reply!

Was this page helpful?
0 / 5 - 0 ratings