Quarkus + Kogito build error: java.lang.IllegalStateException: Cannot find class info in jandex index for java.time.LocalDateTime

Quarkus + Kogito build error: java.lang.IllegalStateException: Cannot find class info in jandex index for java.time.LocalDateTime

我有一个使用 Quarkus 和 Kogito 的多模块 Maven 项目,具有 MongoDb 持久性。 具有 Kogito 流程定义的模块正在使用来自另一个模块的 bean。 其中一个 bean 有 属性 类型 java.time.LocalDateTime

public class SomeBean {
    ...
    private LocalDateTime changeDatetime;

    public SomeBean() {
    }

    ...
    public LocalDateTime getChangeDatetime() {
        return changeDatetime;
    }

    public void setChangeDatetime(LocalDateTime changeDatetime) {
        this.changeDatetime = changeDatetime;
    }
}

当运行一个进程@QuarkusTest时,我得到以下错误:

io.quarkus.builder.BuildException: Build failure: Build failed due to errors
        [error]: Build step org.kie.kogito.quarkus.processes.deployment.ProcessesAssetsProcessor#postGenerationProcessing threw an exception: java.lang.RuntimeException: Error while generating proto for model class com.example.PrcessInputBean Cannot find class info in jandex index for java.time.LocalDateTime
        at org.kie.kogito.codegen.process.persistence.proto.AbstractProtoGenerator.generate(AbstractProtoGenerator.java:143)
        at org.kie.kogito.codegen.process.persistence.proto.AbstractProtoGenerator.protoOfDataClasses(AbstractProtoGenerator.java:52)
        at org.kie.kogito.codegen.process.persistence.PersistenceGenerator.generateProtoMarshaller(PersistenceGenerator.java:278)
        at org.kie.kogito.codegen.process.persistence.PersistenceGenerator.internalGenerate(PersistenceGenerator.java:179)
        at org.kie.kogito.codegen.core.AbstractGenerator.generate(AbstractGenerator.java:69)
       ...
Caused by: java.lang.IllegalStateException: Cannot find class info in jandex index for java.time.LocalDateTime
        at org.kie.kogito.quarkus.processes.deployment.JandexProtoGenerator.messageFromClass(JandexProtoGenerator.java:159)
        at org.kie.kogito.quarkus.processes.deployment.JandexProtoGenerator.messageFromClass(JandexProtoGenerator.java:51)
        at org.kie.kogito.codegen.process.persistence.proto.AbstractProtoGenerator.internalGenerate(AbstractProtoGenerator.java:167)
        at org.kie.kogito.quarkus.processes.deployment.JandexProtoGenerator.messageFromClass(JandexProtoGenerator.java:163)
        at org.kie.kogito.quarkus.processes.deployment.JandexProtoGenerator.messageFromClass(JandexProtoGenerator.java:51)
        at org.kie.kogito.codegen.process.persistence.proto.AbstractProtoGenerator.internalGenerate(AbstractProtoGenerator.java:167)
        at org.kie.kogito.quarkus.processes.deployment.JandexProtoGenerator.messageFromClass(JandexProtoGenerator.java:163)
        at org.kie.kogito.quarkus.processes.deployment.JandexProtoGenerator.messageFromClass(JandexProtoGenerator.java:51)
        at org.kie.kogito.codegen.process.persistence.proto.AbstractProtoGenerator.internalGenerate(AbstractProtoGenerator.java:167)
        at org.kie.kogito.quarkus.processes.deployment.JandexProtoGenerator.messageFromClass(JandexProtoGenerator.java:163)
        at org.kie.kogito.quarkus.processes.deployment.JandexProtoGenerator.messageFromClass(JandexProtoGenerator.java:51)
        at org.kie.kogito.codegen.process.persistence.proto.AbstractProtoGenerator.internalGenerate(AbstractProtoGenerator.java:167)
        at org.kie.kogito.quarkus.processes.deployment.JandexProtoGenerator.messageFromClass(JandexProtoGenerator.java:163)
        at org.kie.kogito.quarkus.processes.deployment.JandexProtoGenerator.messageFromClass(JandexProtoGenerator.java:51)
        at org.kie.kogito.codegen.process.persistence.proto.AbstractProtoGenerator.internalGenerate(AbstractProtoGenerator.java:167)
        at org.kie.kogito.codegen.process.persistence.proto.AbstractProtoGenerator.generate(AbstractProtoGenerator.java:136)
        ... 18 more

我尝试了以下解决方案: 但它不起作用。

我注意到如果我从 bean 中删除 java.time.LocalDateTime 属性,测试 运行 没问题。 如何配置 Jandex 以索引 java.time.LocalDateTime 并消除此错误?

Kogito 最近已添加对 java.time.LocalDateTime 的支持,并将在下一版本 1.18 中提供。0.Final,请参阅 https://issues.redhat.com/browse/KOGITO-6756