kafka-connect error: cannot find or load main class

大城市里の小女人 提交于 2019-12-08 05:46:16

问题


I am following the official docs to implement the kakf-connect to read data from a file.

I have kafka running perfectly. A producer and consumer sending and receiving messages.

However, when I run the following command:

sudo ./bin/connect-standalone.sh config/connect-standalone.properties config/connect-file-source.properties

I am getting the following error:

Error: Could not find or load main class org.apache.kafka.connect.cli.ConnectStandalone

I crossed checked and I have the file ConnectStandalone here connect/runtime/src/main/java/org/apache/kafka/connect/cli/ConnectStandalone.

My connect-file-source.properties is as follows:

name=local-file-source
connector.class=org.apache.kafka.connect.file.FileStreamSourceConnector
tasks.max=1
file=test.txt
topic=spark-kafka

Is there something missing? What should I do to get rid of this error?


回答1:


So being fairly java ignorant I think that the problem is that kafka-connect isn't included in the tarballs that kafka provides.

I instead switched to using the confluent platform, and connect works great using that tarball:

http://www.confluent.io/developer#download



来源:https://stackoverflow.com/questions/35179108/kafka-connect-error-cannot-find-or-load-main-class

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!