kafka-connect错误:无法找到或加载主类 [英] kafka-connect error: cannot find or load main class

查看:983
本文介绍了kafka-connect错误:无法找到或加载主类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在关注正式文档以实施 kakf-connect 从文件中读取数据。

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

我有完美的kafka运行。生产者和消费者发送和接收消息。

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

我收到以下错误:


错误:无法找到或加载主类org.apache.kafka.connect.cli .ConnectStandalone

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

我划线检查了我的文件 ConnectStandalone 这里 connect / runtime / src / main / java / 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.

我的 connect -file-source.properties 如下:

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?

推荐答案

因此对java无知我觉得问题是kafka- connect不包含在kafka提供的tarball中。

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

我转而使用汇合平台,并且使用该tarball进行连接效果很好:

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

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

这篇关于kafka-connect错误:无法找到或加载主类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆