java.lang.ClassNotFoundException: org.apache.jute.OutputArchive 使用最新的 spring-kafka 和 spring-kafka-test 2.5.2
java.lang.ClassNotFoundException: org.apache.jute.OutputArchive with latest spring-kafka and spring-kafka-test 2.5.2
我们有一个带有 spring-kafka 的 spring 启动应用程序,我们正在使用嵌入式 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]
应该由zookeeper自己传递拉入;这是给我的:
您不必在 pom 中手动声明它;所以也许是一些 Maven 问题?
我们有一个带有 spring-kafka 的 spring 启动应用程序,我们正在使用嵌入式 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]
应该由zookeeper自己传递拉入;这是给我的:
您不必在 pom 中手动声明它;所以也许是一些 Maven 问题?