Intermittent error for unknown property used in expression for spring bean

Hey, I have a problem recently in my production servers that I am unable to replicate on a development locally and happens intermittently.

For context, I am using a Spring boot application (v3.2.5) with flowable engine (v7.0.0).

Situation:
I have a custom task called JavascriptTask that runs some javascript code inside. The functionality does not really matter. This task extends from a base ServiceTask class that implements JavaDelegate. The JavascriptTask is annotated a @Component to be registered as a spring bean. So the definitions for the classes look something like this:

public abstract class ServiceTask implements JavaDelegate {...//code}

@Component
public class JavascriptTask extends ServiceTask

The only configurations done to the flowable process engine is through a configuration class via Spring, the code replicated below

@Configuration
@AutoConfigureOrder(Ordered.LOWEST_PRECEDENCE)
@AutoConfigureAfter(ProcessEngineAutoConfiguration.class)
@Slf4j
public class CustomFlowableEngineConfiguration {

  @Autowired TaskMetricsListener taskMetricsListener;
  @Autowired TaskErrorListener taskErrorListener;

  @Bean
  EngineConfigurationConfigurer<SpringProcessEngineConfiguration> engineConfigurationConfigurer() {
    return engineConfiguration -> {
      engineConfiguration.setEventListeners(List.of(taskMetricsListener, taskErrorListener));
    };
  }
}

This set of code works fine 99.9% of the time. However, in some instances started with this task, we observe error log lines saying: Unknown property used in expression ${javascriptTask}. This then causes the javascript to fail for no reason and stop functioning.

Here’s a snippet of the XML we have for this task

<bpmn:serviceTask id="Activity_0x6hm42" name="Javascript Task" flowable:delegateExpression="${javascriptTask}" flowable:async="true">
<bpmn:extensionElements>
<flowable:taskListener event="create" delegateExpression="${javascriptTask}"/>
<flowable:failedJobRetryTimeCycle>R3/PT30S</flowable:failedJobRetryTimeCycle>
</bpmn:extensionElements>
<bpmn:incoming>Flow_1gvi67e</bpmn:incoming>
<bpmn:outgoing>Flow_0x1qxrk</bpmn:outgoing>
</bpmn:serviceTask>`

The worse part is that we cannot replicate this issue on our local machines. Only when it goes to production does it ever occur. :cry:
What could potentially be the problem? Please assist. Thanks!

1 Like

Facing similar issue, it’s intermittent and seems like Flowable engine was not able to locate the beans sometimes

Hey @jkli123 and @MrPickles, how many instances of Flowable are you running? Are you by any chance running different applications on the same database?

This to me looks like you have 2 different applications (one that has the bean and another that doesn’t) and both of those applications are using the same database. This means that both applications are going to see the same process, but not the bean.

Cheers,
Filip

1 Like

Hey @filiphr

We are only running one instance of flowable with spring boot

1 Like