【问题标题】:Using camel with Google PubSub component gives NoClassDefFoundError for com.google.api.client.repackaged.com.google.common.base.Strings将骆驼与 Google PubSub 组件一起使用会为 com.google.api.client.repackaged.com.google.common.base.Strings 提供 NoClassDefFoundError
【发布时间】:2021-05-08 02:00:51
【问题描述】:

我有一个使用 Camel 的 SpringBoot 应用程序,我想使用 Google PubSub 组件将消息推送到主题。但是,当我的代码通过以下方式使用 ProducerTemplate 到 PubSub 时:

producer.sendBody("google-pubsub://<my-project-id>:<my-topic-name>");

我得到 com.google.api.client.repackaged.com.google.common.base.Strings 的 NoClassDefFoundErr。

在我的 build.gradle 我有:

编译组:'org.apache.camel',名称:'camel-google-pubsub',版本:camelVersion

编译组:'org.apache.camel.springboot',名称:'camel-google-pubsub-starter',版本:camelVersion

我到处寻找解决方案。我已经在 Maven 存储库中搜索了任何可能有这个 Strings 类但没有运气的 jar。

谁能提出解决方案?

谢谢。

【问题讨论】:

    标签: spring-boot apache-camel google-cloud-pubsub


    【解决方案1】:

    我想我找到了答案。我们目前正在使用 Camel 2.24.1。在 org.apache.camel.component.google.pubsub.GooglePubsubEndpoint 中,代码使用该类。在后来的骆驼版本中,显然他们没有。我尝试了 2.25.3,这个问题就消失了。

    我不知道他们为什么要使用这个神器,但至少我知道我可以通过使用不同版本的 Camel 来解决它。

    【讨论】:

      猜你喜欢
      • 2019-07-11
      • 1970-01-01
      • 1970-01-01
      • 2016-10-18
      • 1970-01-01
      • 1970-01-01
      • 2018-06-21
      • 2022-09-26
      • 1970-01-01
      相关资源
      最近更新 更多