gpt4 book ai didi

java.lang.NoClassDefFoundError : Could not initialize class com. google.pubsub.v1.ProjectTopicName

转载 作者:行者123 更新时间:2023-12-05 07:07:33 25 4
gpt4 key购买 nike

我正在使用此处提供的 CloudPubSubConnector 将 Kafka 与 Google PubSub 集成:https://github.com/GoogleCloudPlatform/pubsub/tree/master/kafka-connector#cloudpubsubconnector-configs在我的机器上运行本地托管的 Kafka 服务器。当我运行连接器时,我得到以下堆栈跟踪:

[2020-05-29 15:20:01,678] ERROR WorkerSinkTask{id=CPSSinkConnector-9} Task threw an uncaught and unrecoverable exception (org.apache.kafka.connect.runtime.WorkerTask:186)
java.lang.NoClassDefFoundError: Could not initialize class com.google.pubsub.v1.ProjectTopicName
at com.google.pubsub.kafka.sink.CloudPubSubSinkTask.createPublisher(CloudPubSubSinkTask.java:353)
at com.google.pubsub.kafka.sink.CloudPubSubSinkTask.start(CloudPubSubSinkTask.java:143)
at org.apache.kafka.connect.runtime.WorkerSinkTask.initializeAndStart(WorkerSinkTask.java:305)
at org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:193)
at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:184)
at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:234)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
[2020-05-29 15:20:01,678] INFO Created connector CPSSinkConnector (org.apache.kafka.connect.cli.ConnectStandalone:112)
[2020-05-29 15:20:01,678] ERROR WorkerSinkTask{id=CPSSinkConnector-9} Task is being killed and will not recover until manually restarted (org.apache.kafka.connect.runtime.WorkerTask:187)
[2020-05-29 15:20:01,678] INFO Stopping CloudPubSubSinkTask (com.google.pubsub.kafka.sink.CloudPubSubSinkTask:386)

我正在尝试了解问题所在。如果我在 GCP VM 上托管 Kafka,连接器工作正常,并且我的 Maven 依赖项似乎设置正确,但由于某种原因它找不到 ProjectTopicName 类。

更新:已解决使用 Kafka 版本 2.4.1 而不是 2.5.0 时,此问题不会持续存在

最佳答案

looks like ProjectTopicName 被意外弃用并在 google-cloud-pubsub 版本 1.104.0 中恢复。您是否可以改用 TopicName 或更新库?

关于java.lang.NoClassDefFoundError : Could not initialize class com. google.pubsub.v1.ProjectTopicName,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62093403/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com