Giter Club home page Giter Club logo

Comments (17)

Dantes-Damir avatar Dantes-Damir commented on June 29, 2024 1

I understood than this error appears when we use java.math.BigDecimal.
@evacchi In our project we tried to use diffrent versions of quarkus, from 2.6.0 to 2.6.3.Final
<quarkus.platform.version>2.6.3.Final</quarkus.platform.version>

from incubator-kie-kogito-examples.

fjtirado avatar fjtirado commented on June 29, 2024

@evacchi Looks like short is not supported in jandex?

from incubator-kie-kogito-examples.

evacchi avatar evacchi commented on June 29, 2024

looks like a classloader-related issue. Which version of Quarkus? /cc @aloubyansky

from incubator-kie-kogito-examples.

Dantes-Damir avatar Dantes-Damir commented on June 29, 2024

@evacchi you can download this project from https://github.com/kiegroup/kogito-examples/tree/stable/kogito-quarkus-examples/process-postgresql-persistence-quarkus stable version and try to add private short number in Traveler class. Here is the pom: pom.txt

from incubator-kie-kogito-examples.

Dantes-Damir avatar Dantes-Damir commented on June 29, 2024

And i got the same error in our project:
2022-01-24 10:38:46,590 DEBUG [io.qua.dep.ste.CombinedIndexBuildStep] (build-4) Index: [I
2022-01-24 10:38:46,591 WARN [io.qua.dep.ste.CombinedIndexBuildStep] (build-4) Failed to index [I: Class does not exist in ClassLoader QuarkusClassLoader:Deployment Class Loader: DEV@7d9e8ef7

I can't share this business model, but it's valid model, it's used in production. So i can't understand what is "[I".

from incubator-kie-kogito-examples.

aloubyansky avatar aloubyansky commented on June 29, 2024

I'll look into this.

from incubator-kie-kogito-examples.

aloubyansky avatar aloubyansky commented on June 29, 2024

@Dantes-Damir should there be anything more than changing the Traveller class and launch dev mode? I did the following

[aloubyansky@localhost process-postgresql-persistence-quarkus]$ git diff
diff --git a/kogito-quarkus-examples/process-postgresql-persistence-quarkus/src/main/java/org/acme/deals/Traveller.java b/kogito-quarkus-examples/process-postgresql-persistence-quarkus/src/main/java/org/acme/deals/Traveller.java
index 02e90894..f980087a 100644
--- a/kogito-quarkus-examples/process-postgresql-persistence-quarkus/src/main/java/org/acme/deals/Traveller.java
+++ b/kogito-quarkus-examples/process-postgresql-persistence-quarkus/src/main/java/org/acme/deals/Traveller.java
@@ -22,6 +22,7 @@ public class Traveller {
     private String email;
     private String nationality;
     private Address address;
+    private java.math.BigDecimal number;
 
     public Traveller() {
 
@@ -75,6 +76,14 @@ public class Traveller {
         this.address = address;
     }
 
+    public java.math.BigDecimal getNumber() {
+        return number;
+    }
+
+    public void setNumber(java.math.BigDecimal number) {
+        this.number = number;
+    }
+

Also tried short. Haven't seen any error yet. Quarkus 2.6.2.Final. Thanks.

from incubator-kie-kogito-examples.

Dantes-Damir avatar Dantes-Damir commented on June 29, 2024

@aloubyansky Did you start project with -Ppersistence?

from incubator-kie-kogito-examples.

aloubyansky avatar aloubyansky commented on June 29, 2024

No, that's what I was missing. Thanks.

from incubator-kie-kogito-examples.

Dantes-Damir avatar Dantes-Damir commented on June 29, 2024

Hi @aloubyansky! Is there any solution for my problem? Maybe any walkaround? Thanks.

from incubator-kie-kogito-examples.

aloubyansky avatar aloubyansky commented on June 29, 2024

Sorry, haven't figured it out yet.

from incubator-kie-kogito-examples.

debu999 avatar debu999 commented on June 29, 2024

We too get the same road block. Had zonedatetime or localdate in the process variable. Getting error for short not in jandex.
Google protobuf have timestamp and date.
Is there anything by which we can specify which datatype to convert.
Currently only String, Integer, Long, Double, Boolean, Date works. We can't add any other data type on kogito
Using 1.16.0.Final and 2.7.0.Final quarkus.
Something in kogito code gen causing the issue.

Also quarkus-kogito-bom is missing 2.7.0.Final build last bild is 2.7.0.CR1.

Please opine on the fix if we need to do any change to fix

from incubator-kie-kogito-examples.

aloubyansky avatar aloubyansky commented on June 29, 2024

@evacchi it doesn't look like a classloading issue to me but something that should be fixed in the proto generator, e.g.

diff --git a/quarkus/extensions/kogito-quarkus-processes-extension/kogito-quarkus-processes-deployment/src/main/java/org/kie/kogito/quarkus/processes/deployment/JandexProtoGenerator.java b/quarkus/extensions/kogito-quarkus-processes-extension/kogito-quarkus-processes-deployment/src/main/java/org/kie/kogito/quarkus/processes/deployment/JandexProtoGenerator.java
index d1d3bdd70e..65c60692a7 100644
--- a/quarkus/extensions/kogito-quarkus-processes-extension/kogito-quarkus-processes-deployment/src/main/java/org/kie/kogito/quarkus/processes/deployment/JandexProtoGenerator.java
+++ b/quarkus/extensions/kogito-quarkus-processes-extension/kogito-quarkus-processes-deployment/src/main/java/org/kie/kogito/quarkus/processes/deployment/JandexProtoGenerator.java
@@ -149,6 +149,9 @@ public class JandexProtoGenerator extends AbstractProtoGenerator<ClassInfo> {
                 }
                 fieldType = typeParameters.get(0).name();
                 protoType = protoType(fieldType.toString());
+            } else if(pd.type().kind() == Kind.ARRAY) {
+                fieldTypeString = "Collection";
+                protoType = protoType(pd.type().asArrayType().component().toString());
             } else {

With that I get passed that error but then it fails with

2022-02-08 18:47:41,649 DEBUG [org.kie.kog.cod.cor.ApplicationGenerator] (build-39) =====
2022-02-08 18:47:42,347 ERROR [org.kie.kog.qua.com.dep.InMemoryCompiler] (build-5) src/main/java/org/kie/kogito/persistence/KogitoProcessInstancesFactoryImpl.java (11:609) : The constructor KogitoProcessInstancesFactory(DataSource, Boolean) is undefined
2022-02-08 18:47:42,347 ERROR [org.kie.kog.qua.com.dep.InMemoryCompiler] (build-5) src/main/java/org/kie/kogito/app/BigDecimalMessageMarshaller.java (32:1158) : The constructor BigDecimal() is undefined
2022-02-08 18:47:42,348 ERROR [org.kie.kog.qua.com.dep.InMemoryCompiler] (build-5) src/main/java/org/kie/kogito/app/BigDecimalMessageMarshaller.java (33:1200) : The method setIntVal(reader.readObject("intVal", java.math.BigInteger.class)) is undefined for the type BigDecimal
2022-02-08 18:47:42,348 ERROR [org.kie.kog.qua.com.dep.InMemoryCompiler] (build-5) src/main/java/org/kie/kogito/app/BigDecimalMessageMarshaller.java (39:1480) : The method getIntVal() is undefined for the type BigDecimal
2022-02-08 18:47:42,348 ERROR [org.kie.kog.qua.com.dep.InMemoryCompiler] (build-5) src/main/java/org/kie/kogito/app/BigDecimalMessageMarshaller.java (40:1557) : The method getScale() is undefined for the type BigDecimal
2022-02-08 18:47:42,349 ERROR [org.kie.kog.qua.com.dep.InMemoryCompiler] (build-5) src/main/java/org/kie/kogito/app/BigIntegerMessageMarshaller.java (32:1158) : The constructor BigInteger() is undefined
2022-02-08 18:47:42,349 ERROR [org.kie.kog.qua.com.dep.InMemoryCompiler] (build-5) src/main/java/org/kie/kogito/app/BigIntegerMessageMarshaller.java (33:1200) : The method setBitCountPlusOne(Integer) is undefined for the type BigInteger
2022-02-08 18:47:42,349 ERROR [org.kie.kog.qua.com.dep.InMemoryCompiler] (build-5) src/main/java/org/kie/kogito/app/BigIntegerMessageMarshaller.java (34:1269) : The method setBitLengthPlusOne(Integer) is undefined for the type BigInteger
2022-02-08 18:47:42,350 ERROR [org.kie.kog.qua.com.dep.InMemoryCompiler] (build-5) src/main/java/org/kie/kogito/app/BigIntegerMessageMarshaller.java (35:1340) : The method setFirstNonzeroIntNumPlusTwo(Integer) is undefined for the type BigInteger
2022-02-08 18:47:42,350 ERROR [org.kie.kog.qua.com.dep.InMemoryCompiler] (build-5) src/main/java/org/kie/kogito/app/BigIntegerMessageMarshaller.java (36:1429) : The method setLowestSetBitPlusTwo(Integer) is undefined for the type BigInteger
2022-02-08 18:47:42,351 ERROR [org.kie.kog.qua.com.dep.InMemoryCompiler] (build-5) src/main/java/org/kie/kogito/app/BigIntegerMessageMarshaller.java (37:1506) : The method setMag(reader.readCollection("mag", new java.util.ArrayList(), Integer.class)) is undefined for the type BigInteger
2022-02-08 18:47:42,351 ERROR [org.kie.kog.qua.com.dep.InMemoryCompiler] (build-5) src/main/java/org/kie/kogito/app/BigIntegerMessageMarshaller.java (38:1600) : The method setSignum(Integer) is undefined for the type BigInteger
2022-02-08 18:47:42,352 ERROR [org.kie.kog.qua.com.dep.InMemoryCompiler] (build-5) src/main/java/org/kie/kogito/app/BigIntegerMessageMarshaller.java (43:1806) : The method getBitCountPlusOne() is undefined for the type BigInteger
2022-02-08 18:47:42,352 ERROR [org.kie.kog.qua.com.dep.InMemoryCompiler] (build-5) src/main/java/org/kie/kogito/app/BigIntegerMessageMarshaller.java (44:1875) : The method getBitLengthPlusOne() is undefined for the type BigInteger
2022-02-08 18:47:42,353 ERROR [org.kie.kog.qua.com.dep.InMemoryCompiler] (build-5) src/main/java/org/kie/kogito/app/BigIntegerMessageMarshaller.java (45:1954) : The method getFirstNonzeroIntNumPlusTwo() is undefined for the type BigInteger
2022-02-08 18:47:42,353 ERROR [org.kie.kog.qua.com.dep.InMemoryCompiler] (build-5) src/main/java/org/kie/kogito/app/BigIntegerMessageMarshaller.java (46:2036) : The method getLowestSetBitPlusTwo() is undefined for the type BigInteger
2022-02-08 18:47:42,354 ERROR [org.kie.kog.qua.com.dep.InMemoryCompiler] (build-5) src/main/java/org/kie/kogito/app/BigIntegerMessageMarshaller.java (47:2103) : The method getMag() is undefined for the type BigInteger
2022-02-08 18:47:42,354 ERROR [org.kie.kog.qua.com.dep.InMemoryCompiler] (build-5) src/main/java/org/kie/kogito/app/BigIntegerMessageMarshaller.java (48:2165) : The method getSignum() is undefined for the type BigInteger

from incubator-kie-kogito-examples.

aloubyansky avatar aloubyansky commented on June 29, 2024

Or possibly org.kie.kogito.codegen.process.persistence.proto.ProtoGenerator.protoType(type) should recognize BigDecimal in similar way it recognizes Date?

from incubator-kie-kogito-examples.

aloubyansky avatar aloubyansky commented on June 29, 2024

@debu999 fyi, 2.7.1.Final has been released today which includes Kogito.

from incubator-kie-kogito-examples.

debu999 avatar debu999 commented on June 29, 2024

Thanks @aloubyansky on the info. A new feature request is added to kogito for including other date formats for marshalling.

https://issues.redhat.com/browse/KOGITO-6756
Hope to use few additional data types soon. Will definitely try out kogito with quarkus inn2.7.1.Final today and share update

from incubator-kie-kogito-examples.

cristianonicolai avatar cristianonicolai commented on June 29, 2024

Fixed on Kogito 1.18, feel free to reopen if issue is not resolved completely.

from incubator-kie-kogito-examples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.