2

我有一个 Quarkus Kafka 消费者。在 VM 模式下,它运行良好。

在我使用以下命令构建本机运行程序之后: ./mvnw package -Pnative

当我在本机模式下运行它时,我有这个异常:

2019-05-23 17:17:42,340 ERROR [io.sma.rea.mes.imp.LegacyConfiguredStreamFactory] (main) Unable to create the publisher or subscriber during initialization: java.lang.IllegalArgumentException: java.lang.reflect.InvocationTargetException
        at io.smallrye.config.ImplicitConverters$StaticMethodConverter.convert(ImplicitConverters.java:99)
        at io.smallrye.config.SmallRyeConfig.convert(SmallRyeConfig.java:133)
        at io.smallrye.config.SmallRyeConfig.getValue(SmallRyeConfig.java:76)
        at io.smallrye.reactive.messaging.impl.ConnectorConfig.getValue(ConnectorConfig.java:57)
        at io.smallrye.reactive.messaging.spi.ConfigurationHelper.asJsonObject(ConfigurationHelper.java:51)
        at io.smallrye.reactive.messaging.kafka.KafkaSource.<init>(KafkaSource.java:35)
        at io.smallrye.reactive.messaging.kafka.KafkaMessagingProvider.getPublisherBuilder(KafkaMessagingProvider.java:40)
        at io.smallrye.reactive.messaging.kafka.KafkaMessagingProvider_ClientProxy.getPublisherBuilder(Unknown Source)
        at io.smallrye.reactive.messaging.impl.LegacyConfiguredStreamFactory.createPublisherBuilder(LegacyConfiguredStreamFactory.java:119)
        at io.smallrye.reactive.messaging.impl.LegacyConfiguredStreamFactory.lambda$initialize$2(LegacyConfiguredStreamFactory.java:100)
        at java.util.HashMap.forEach(HashMap.java:1289)
        at io.smallrye.reactive.messaging.impl.LegacyConfiguredStreamFactory.initialize(LegacyConfiguredStreamFactory.java:100)
        at io.smallrye.reactive.messaging.impl.LegacyConfiguredStreamFactory_ClientProxy.initialize(Unknown Source)
        at java.util.Iterator.forEachRemaining(Iterator.java:116)
        at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
        at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
        at io.smallrye.reactive.messaging.extension.MediatorManager.initializeAndRun(MediatorManager.java:103)
        at io.smallrye.reactive.messaging.extension.MediatorManager_ClientProxy.initializeAndRun(Unknown Source)
        at io.quarkus.smallrye.reactivemessaging.runtime.SmallRyeReactiveMessagingLifecycle.onApplicationStart(SmallRyeReactiveMessagingLifecycle.java:18)
        at io.quarkus.smallrye.reactivemessaging.runtime.SmallRyeReactiveMessagingLifecycle_Observer_onApplicationStart_4e8937813d9e8faff65c3c07f88fa96615b70e70.notify(Unknown Source)
        at io.quarkus.arc.EventImpl$Notifier.notify(EventImpl.java:244)
        at io.quarkus.arc.EventImpl.fire(EventImpl.java:85)
        at io.quarkus.arc.runtime.LifecycleEventRunner.fireStartupEvent(LifecycleEventRunner.java:39)
        at io.quarkus.arc.runtime.ArcDeploymentTemplate.handleLifecycleEvents(ArcDeploymentTemplate.java:115)
        at io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent20.deploy(Unknown Source)
        at io.quarkus.runner.ApplicationImpl1.doStart(Unknown Source)
        at io.quarkus.runtime.Application.start(Application.java:101)
        at io.quarkus.runtime.Application.run(Application.java:213)
        at io.quarkus.runner.GeneratedMain.main(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Method.invoke(Method.java:498)
        at io.smallrye.config.ImplicitConverters$StaticMethodConverter.convert(ImplicitConverters.java:97)
        ... 28 more
Caused by: java.lang.NumberFormatException: For input string: "org.apache.kafka.common.serialization.StringDeserializer"
        at java.lang.Integer.parseInt(Integer.java:580)
        at java.lang.Integer.valueOf(Integer.java:766)
        ... 30 more

4

1 回答 1

1

这是自 0.16 版以来此PR已修复的错误2221 。

尝试任何新的 Quarkus 版本来修复它。

于 2019-09-10T18:55:58.907 回答