Java 11 Upgrade - ENGINE-09025 No Command Context Active

Hi there,

We’re attempting to upgrade to Java 11, we’re migrating from:
Java 8
SpringBoot 2.0.5
Camunda SpringBoot Starter 3.0.0

Java 11
SpringBoot 2.1.12
Camunda SpringBoot Starter 3.2.9

We’re encountering issues in our application, specifically in scenarios where the web request accesses the historical variable table with the following error:

`Caused by: java.lang.IllegalStateException: ENGINE-09025 Operation StringUtil.fromBytes requires active command context. No command context active on thread Thread[ForkJoinPool.commonPool-worker-3,5,main].
at org.camunda.bpm.engine.impl.util.EngineUtilLogger.notInsideCommandContext(EngineUtilLogger.java:187)
at org.camunda.bpm.engine.impl.util.EnsureUtil.ensureActiveCommandContext(EnsureUtil.java:404)
at org.camunda.bpm.engine.impl.util.StringUtil.fromBytes(StringUtil.java:102)
at org.camunda.bpm.engine.impl.variable.serializer.AbstractSerializableValueSerializer.getSerializedStringValue(AbstractSerializableValueSerializer.java:112)
at org.camunda.bpm.engine.impl.variable.serializer.AbstractSerializableValueSerializer.readValue(AbstractSerializableValueSerializer.java:76)
at org.camunda.bpm.engine.impl.variable.serializer.AbstractSerializableValueSerializer.readValue(AbstractSerializableValueSerializer.java:30)`

We’re pretty stumped on this and would appreciate some help to get the upgrade done smoothly.

Cheers,

As it turns out, the application that I’m upgrading employs a workaround to add custom mybatis mappings that is prescribed by the example: Camunda 7.7 MyBatis Custom queries example.

This link no longer exists in the later versions; presumably because it’s no longer correct (and it’s very hacky in nature).

So what I did instead is the followings:

  1. Have custom mybatis configuration that would include both camunda’s mapping and the custom mappings

  2. Extend SpringProcessEngineConfiguration and override getMyBatisXmlConfigurationSteam (yes, the method is incorrectly spelt) and point to the custom configuration in 1.

  3. Have the following beans overriden to make use of the custom configuration.

     @Bean
     @Primary
     public ProcessEngineFactoryBean processEngine(CustomProcessEngineConfiguration configuration) {
         ProcessEngineFactoryBean factoryBean = new ProcessEngineFactoryBean();
         factoryBean.setProcessEngineConfiguration(configuration);
         return factoryBean;
     }
    
     @Bean
     @Primary
     public CustomProcessEngineConfiguration processEngineConfiguration(List<ProcessEnginePlugin> processEnginePlugins) {
         CustomProcessEngineConfiguration configuration = new CustomProcessEngineConfiguration();
         CamundaSpringBootUtil.initCustomFields(configuration);
         configuration.getProcessEnginePlugins().add(new CompositeProcessEnginePlugin(processEnginePlugins));
         return configuration;
     }
    

`
Hopefully this will give somebody an idea if they had to work with Custom MyBatis Query.

1 Like