gpt4 book ai didi

java - SpringXD部署Stream时出错: StringDeserializer class could not be found

转载 作者:行者123 更新时间:2023-12-02 13:27:20 25 4
gpt4 key购买 nike

我正在配置自定义 kafka 源,但收到与 value.deserializer kafka 属性相关的错误。

这是我的配置:

<!--Consumer -->
<bean id="container1"
class="org.springframework.kafka.listener.KafkaMessageListenerContainer">
<constructor-arg>
<bean class="org.springframework.kafka.core.DefaultKafkaConsumerFactory">
<constructor-arg>
<map>
<entry key="bootstrap.servers" value="localhost:9092" />
<entry key="enable.auto.commit" value="false" />
<entry key="auto.commit.interval.ms" value="100" />
<entry key="session.timeout.ms" value="15000" />
<entry key="group.id" value="bridge-stream-testing" />
<entry key="key.deserializer" value="org.apache.kafka.common.serialization.IntegerDeserializer" />
<entry key="value.deserializer" value="org.apache.kafka.common.serialization.StringDeserializer" />
</map>
</constructor-arg>
</bean>
</constructor-arg>

我确实看到了 org.apache.kafka.common.serialization.StringDeserializer 类(我可以单击类名称,它会将我带到 jar 文件。

以防万一这是我的 pom 文件中的内容:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.xd</groupId>
<artifactId>spring-xd-module-parent</artifactId>
<version>1.3.2.RELEASE</version>
</parent>
<groupId>ejemplos.spring</groupId>
<artifactId>kafka-source-latest-api</artifactId>
<version>0.0.1-SNAPSHOT</version>

<dependencies>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-kafka</artifactId>
<version>2.1.0.RELEASE</version>
</dependency>

<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>0.10.0.1</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
<version>1.1.0.RELEASE</version>
</dependency>


</dependencies>

<repositories>
<repository>
<id>pentaho-releases</id>
<url>http://repository.pentaho.org/artifactory/repo/</url>
</repository>
</repositories>
</project>

这些是我收到的日志:https://gist.github.com/columb1a/2833f1ac751436df1caa730ce1a0eb37

最佳答案

尝试将 kafka-clients jar 放入共享 /lib 而不是模块类路径中。我只是猜测,但看起来该类试图通过 Thread.currentThread().getContextClassLoader(); 加载,而不是特定于模块。

关于java - SpringXD部署Stream时出错: StringDeserializer class could not be found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43331225/

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