0

我们有一个带有 spring-kafka 的 spring boot 应用程序,我们正在使用嵌入式 kafka 进行测试。我们已将 Spring boot 升级到 2.3.1 版本,并遵循最新的 spring kafka 依赖项,即 2.5.2。现在我们在执行测试时遇到了错误。我检查了zookeeper-jute依赖项存在于zookeeper-3.5.7中。

当我在我们的 pom 中添加zookeeper-jute依赖项时,它工作正常

Caused by: java.lang.ClassNotFoundException: org.apache.jute.OutputArchive
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_51]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_51]
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) ~[?:1.8.0_51]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_51]
    at org.springframework.kafka.test.EmbeddedKafkaBroker$EmbeddedZookeeper.<init>(EmbeddedKafkaBroker.java:660) ~[spring-kafka-test-2.5.2.RELEASE.jar:2.5.2.RELEASE]
    at org.springframework.kafka.test.EmbeddedKafkaBroker.afterPropertiesSet(EmbeddedKafkaBroker.java:287) ~[spring-kafka-test-2.5.2.RELEASE.jar:2.5.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1855) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1792) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:407) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
    at org.springframework.kafka.test.context.EmbeddedKafkaContextCustomizer.customizeContext(EmbeddedKafkaContextCustomizer.java:116) ~[spring-kafka-test-2.5.2.RELEASE.jar:2.5.2.RELEASE]
    at org.springframework.boot.test.context.SpringBootContextLoader$ContextCustomizerAdapter.initialize(SpringBootContextLoader.java:302) ~[spring-boot-test-2.3.1.RELEASE.jar:2.3.1.RELEASE]
    at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:626) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
    at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:370) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
4

1 回答 1

0

它应该由 zookeeper 自己传递;这是给我的:

在此处输入图像描述

您不必在 pom 中手动声明它;所以也许是一些行家问题?

于 2020-06-22T17:22:56.863 回答