Uploaded image for project: 'Kogito'
  1. Kogito
  2. KOGITO-650

NPE when generating a model that uses beans as local process variables

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Blocker
    • 1.0.0.Final
    • 0.5.0
    • Core Engine
    • None
    • Hide
      1. Clone https://github.com/JoaoCamposFrom94/bpmdemo
      2. Checkout tag v0.1.a
      3. Run mvn compile quarkus:dev - it should fail to build and validate that there is an issue

      Run a diff check of src/main/resources/com/demo/form/processes/create.bpmn from tag v0.1.a and v0.1b to see what changed.

      Show
      Clone https://github.com/JoaoCamposFrom94/bpmdemo Checkout tag v0.1.a Run mvn compile quarkus:dev - it should fail to build and validate that there is an issue Run a diff check of src/main/resources/com/demo/form/processes/create.bpmn from tag v0.1.a and v0.1b to see what changed.
    • 2020 Week 04-06 (from Jan 20), 2020 Week 07-09 (from Feb 10)

    Description

      TL;DR: Using beans as a process variable makes the build fail.

      This repo has 2 releases, "a" and "b". Release "a" has a simple model with a service task that gives an exception and release "b" has the same model but without the NPE.

      When compiling "a" with "mvn clean compile quarkus:dev" the exception below is thrown.
      The attribute changed in the Eclipse jBPM modeller to make the example not crash while deploying can be found in the attachments.

      Using any type of the java.lang.* except Object package is fine.

      [INFO] --- quarkus-maven-plugin:1.0.0.Final:dev (default-cli) @ bpm-demo ---
      Listening for transport dt_socket at address: 5005
      12:13:55,956 INFO  [org.jbo.threads] JBoss Threads version 3.0.0.Final
      12:14:00,513 ERROR [io.qua.dev.DevModeMain] Failed to start Quarkus: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
              [error]: Build step io.quarkus.kogito.deployment.KogitoAssetsProcessor#generateModel threw an exception: java.lang.RuntimeException: java.lang.RuntimeException: Error while generating proto for data model
              at io.quarkus.kogito.deployment.JandexProtoGenerator.extractDataClasses(JandexProtoGenerator.java:119)
              at org.kie.kogito.codegen.process.persistence.PersistenceGenerator.generate(PersistenceGenerator.java:101)
              at io.quarkus.kogito.deployment.KogitoAssetsProcessor.generatePersistenceInfo(KogitoAssetsProcessor.java:99)
              at io.quarkus.kogito.deployment.KogitoAssetsProcessor.generateModel(KogitoAssetsProcessor.java:173)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.base/java.lang.reflect.Method.invoke(Method.java:566)
              at io.quarkus.deployment.ExtensionLoader$1.execute(ExtensionLoader.java:941)
              at io.quarkus.builder.BuildContext.run(BuildContext.java:415)
              at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
              at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2011)
              at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1535)
              at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1426)
              at java.base/java.lang.Thread.run(Thread.java:834)
              at org.jboss.threads.JBossThread.run(JBossThread.java:479)
      Caused by: java.lang.RuntimeException: Error while generating proto for data model
              at io.quarkus.kogito.deployment.JandexProtoGenerator.generate(JandexProtoGenerator.java:56)
              at io.quarkus.kogito.deployment.JandexProtoGenerator.generateModelClassProto(JandexProtoGenerator.java:133)
              at io.quarkus.kogito.deployment.JandexProtoGenerator.extractDataClasses(JandexProtoGenerator.java:117)
              ... 15 more
      Caused by: java.lang.NullPointerException
              at io.quarkus.kogito.deployment.JandexProtoGenerator.messageFromClass(JandexProtoGenerator.java:64)
              at io.quarkus.kogito.deployment.JandexProtoGenerator.messageFromClass(JandexProtoGenerator.java:90)
              at io.quarkus.kogito.deployment.JandexProtoGenerator.messageFromClass(JandexProtoGenerator.java:90)
              at io.quarkus.kogito.deployment.JandexProtoGenerator.messageFromClass(JandexProtoGenerator.java:90)
              at io.quarkus.kogito.deployment.JandexProtoGenerator.messageFromClass(JandexProtoGenerator.java:90)
              at io.quarkus.kogito.deployment.JandexProtoGenerator.generate(JandexProtoGenerator.java:53)
              ... 17 more
      
      

      Edit:
      As a workaround for now I'm serializing my objects to insert it in the engine as a String and deserializing back to object on the service task method. This works for now to try Kogito but is a blocker for a production system.

      Attachments

        Activity

          People

            rhn-support-rromerom Ruben Romero Montes
            jccampos-tdx João Campos (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: