我有一个使用 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
并消除此错误?