I have a multi-module Maven project that uses Quarkus and Kogito, with MongoDb persistence.
The module with the Kogito process definition is using beans from another module.
One of the beans has a property of 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;
}
}
When running a @QuarkusTest
for a process, I get the following error:
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
I tried solutions from: How to create a Jandex index in Quarkus for classes in a external module but it does not work.
I noticed that if I remove the java.time.LocalDateTime
property from the bean, the test is running fine.
How can I configure Jandex to index java.time.LocalDateTime
and get rid of this error?
support for
java.time.LocalDateTime
has been added to Kogito recently and will be available in the next release, 1.18.0.Final, see https://issues.redhat.com/browse/KOGITO-6756