Open Edition

 View Only
Expand all | Collapse all

Enabling async executor service in KIE Server in Spring Boot fails causes async step in process to fail

  • 1.  Enabling async executor service in KIE Server in Spring Boot fails causes async step in process to fail

    Posted Tue February 27, 2024 01:28 PM

    We noticed that when we tried to set a service task as async on the UI we would get this message once the process was executed and the service would be called -

    No async executor service found continuing as sync operation...

    That led us to the documentation found here (section 5.5 - https://access.redhat.com/documentation/en-us/ibm_business_automation_manager_open_editions/8.0/html-single/integrating_ibm_business_automation_manager_open_editions_with_other_products_and_components/index) that mentions that in order to enable asynchronous execution you need to set the executor to enabled in application.properties via this property -

    jbpm.executor.enabled=true

    We set the property along with a few others mentioned in the documentation so our new properties are -

    #jbpm executor configuration

    jbpm.executor.enabled=true

    jbpm.executor.retries=5

    jbpm.executor.interval=0

    jbpm.executor.threadPoolSize=1

    jbpm.executor.timeUnit=SECONDS

    After making that change any time a task that has been set to async is executed, we get this error stack -

    2024-02-05 17:22:53.108  WARN 6936 --- [pool-8-thread-1] o.j.e.i.AbstractAvailableJobsExecutor    : Error during command org.jbpm.process.core.async.AsyncSignalEventCommand error message Cannot read the array length because "buf" is null

    java.lang.NullPointerException: Cannot read the array length because "buf" is null

                    at java.base/java.io.ByteArrayInputStream.<init>(ByteArrayInputStream.java:108) ~[na:na]

                    at org.jbpm.persistence.processinstance.ProcessInstanceInfo.getProcessInstance(ProcessInstanceInfo.java:178) ~[jbpm-persistence-jpa-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.jbpm.persistence.processinstance.JPAProcessInstanceManager.getProcessInstance(JPAProcessInstanceManager.java:200) ~[jbpm-persistence-jpa-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.jbpm.process.instance.ProcessRuntimeImpl.getProcessInstance(ProcessRuntimeImpl.java:338) ~[jbpm-flow-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.jbpm.process.instance.ProcessRuntimeImpl.getProcessInstance(ProcessRuntimeImpl.java:334) ~[jbpm-flow-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.drools.core.impl.StatefulKnowledgeSessionImpl.getProcessInstance(StatefulKnowledgeSessionImpl.java:1852) ~[drools-core-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.drools.core.command.runtime.process.SignalEventCommand.execute(SignalEventCommand.java:120) ~[drools-core-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.drools.core.command.runtime.process.SignalEventCommand.execute(SignalEventCommand.java:37) ~[drools-core-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.drools.core.fluent.impl.PseudoClockRunner.executeBatch(PseudoClockRunner.java:102) ~[drools-core-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.drools.core.fluent.impl.PseudoClockRunner.executeBatches(PseudoClockRunner.java:69) ~[drools-core-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.drools.core.fluent.impl.PseudoClockRunner.execute(PseudoClockRunner.java:61) ~[drools-core-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.drools.core.fluent.impl.PseudoClockRunner.execute(PseudoClockRunner.java:39) ~[drools-core-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:39) ~[drools-core-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.drools.persistence.PersistableRunner$TransactionInterceptor.execute(PersistableRunner.java:608) ~[drools-persistence-jpa-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.drools.persistence.PersistableRunner$TransactionInterceptor.execute(PersistableRunner.java:568) ~[drools-persistence-jpa-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:39) ~[drools-core-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.internalExecute(OptimisticLockRetryInterceptor.java:102) ~[drools-persistence-jpa-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.execute(OptimisticLockRetryInterceptor.java:83) ~[drools-persistence-jpa-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.execute(OptimisticLockRetryInterceptor.java:44) ~[drools-persistence-jpa-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:39) ~[drools-core-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.drools.persistence.jta.TransactionLockInterceptor.execute(TransactionLockInterceptor.java:73) ~[drools-persistence-api-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.drools.persistence.jta.TransactionLockInterceptor.execute(TransactionLockInterceptor.java:45) ~[drools-persistence-api-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:39) ~[drools-core-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.jbpm.runtime.manager.impl.error.ExecutionErrorHandlerInterceptor.internalExecute(ExecutionErrorHandlerInterceptor.java:66) ~[jbpm-runtime-manager-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.jbpm.runtime.manager.impl.error.ExecutionErrorHandlerInterceptor.execute(ExecutionErrorHandlerInterceptor.java:52) ~[jbpm-runtime-manager-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.jbpm.runtime.manager.impl.error.ExecutionErrorHandlerInterceptor.execute(ExecutionErrorHandlerInterceptor.java:29) ~[jbpm-runtime-manager-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.drools.persistence.PersistableRunner.execute(PersistableRunner.java:400) ~[drools-persistence-jpa-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.drools.persistence.PersistableRunner.execute(PersistableRunner.java:68) ~[drools-persistence-jpa-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.drools.core.runtime.InternalLocalRunner.execute(InternalLocalRunner.java:37) ~[drools-core-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.drools.core.runtime.InternalLocalRunner.execute(InternalLocalRunner.java:41) ~[drools-core-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.signalEvent(CommandBasedStatefulKnowledgeSession.java:255) ~[drools-core-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.jbpm.process.core.async.AsyncSignalEventCommand.execute(AsyncSignalEventCommand.java:53) ~[jbpm-flow-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.jbpm.executor.impl.AbstractAvailableJobsExecutor.executeGivenJob(AbstractAvailableJobsExecutor.java:140) ~[jbpm-executor-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.jbpm.executor.impl.AvailableJobsExecutor.executeJob(AvailableJobsExecutor.java:33) ~[jbpm-executor-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at org.jbpm.executor.impl.concurrent.PrioritisedRunnable.run(PrioritisedRunnable.java:47) ~[jbpm-executor-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[na:na]

                    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]

                    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[na:na]

                    at org.jbpm.executor.impl.concurrent.PrioritisedScheduledFutureTask.run(PrioritisedScheduledFutureTask.java:41) ~[jbpm-executor-7.67.2.Final-redhat-00008.jar:7.67.2.Final-redhat-00008]

                    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[na:na]

                    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[na:na]

                    at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]

    Debugging into it, it looks like the processInstance is null for whatever reason. We've been unable to find any information as far as what else might be needed to allow asynchronous tasks. Can you let us know what needs to be done?



    ------------------------------
    Mei Yeoh
    ------------------------------



  • 2.  RE: Enabling async executor service in KIE Server in Spring Boot fails causes async step in process to fail

    Posted Wed February 28, 2024 09:34 AM

    Please check your database because it seems there is a row corrupted in there.

    Process instance info in the blob field. you can look into the job and check the parameters to see which is the process instance being corrupted (ERROR state in the job table)



    ------------------------------
    Enrique González Martínez
    ------------------------------