0

我有一个使用 Quarkus 和 Kogito 的多模块 Maven 项目,具有 MongoDb 持久性。具有 Kogito 流程定义的模块正在使用来自另一个模块的 bean。其中一个 bean 具有 type 的属性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

我尝试了以下解决方案:如何在 Quarkus 中为外部模块中的类创建 Jandex 索引, 但它不起作用。

我注意到如果我java.time.LocalDateTime从 bean 中删除该属性,测试运行良好。如何将 Jandex 配置为索引java.time.LocalDateTime并消除此错误?

4

2 回答 2

0

自 8 AFAIK 以来,java.time 包含在 JRE 中。

你确定你用 Java 8 运行它吗?

于 2022-02-22T10:00:43.730 回答
0

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

于 2022-02-24T08:30:53.207 回答