# Failed to instantiate flowable.engine.RuntimeService ,Migration from Activiti 5 to Flowable 6

**URL:** <https://forum.flowable.org/t/failed-to-instantiate-flowable-engine-runtimeservice-migration-from-activiti-5-to-flowable-6/11646>\
**Category:** Flowable Engine\
**Created:** [July 19, 2024, 7:33am UTC](https://forum.flowable.org/t/failed-to-instantiate-flowable-engine-runtimeservice-migration-from-activiti-5-to-flowable-6/11646 "2024-07-19T07:33:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Otto](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/otto/32/3533_2.png) [@Otto](https://forum.flowable.org/u/Otto)\
**Post date:** [July 19, 2024, 7:33am UTC](https://forum.flowable.org/t/failed-to-instantiate-flowable-engine-runtimeservice-migration-from-activiti-5-to-flowable-6/11646/1 "2024-07-19T07:33:28Z")

</div>

I am migrating from Activiti 5 to Flowable 6 and encountering an issue when initializing `RuntimeService`. Despite having all necessary libraries imported and Flowable 5 compatibility enabled, I receive the following error:

\*_Error:_

```auto
Failed to instantiate [org.flowable.engine.RuntimeService]: Factory method 'runtimeService' threw exception with message: Unsupported process engine configuration.

```

### Additional Details:

- **Dependencies:** The `flowable5-compatibility` and other Flowable libraries are correctly added to the `pom.xml`.
- **Configuration:** Flowable 5 compatibility is enabled in the `SpringProcessEngineConfiguration`.
- **Database:** I am using pre-existing Activiti 5 tables and have some ongoing processes.

### Spring Configuration:

Here is the relevant configuration I am using:

```auto
@Configuration
public class FlowableConfiguration {
    //... other beans and configuration

    @Bean
    public DefaultFlowable5CompatibilityHandler flowable5CompatibilityHandler() {
        return new DefaultFlowable5CompatibilityHandler();
    }

    @Bean
    public SpringProcessEngineConfiguration springProcessEngineConfiguration(
            DataSource dataSource,
            PlatformTransactionManager transactionManager,
            DefaultAsyncJobExecutor asyncJobExecutor,
            DefaultFlowable5CompatibilityHandler flowable5CompatibilityHandler) throws IOException {

        SpringProcessEngineConfiguration config = new SpringProcessEngineConfiguration();
        config.setDataSource(dataSource);
        config.setTransactionManager(transactionManager);
        config.setDatabaseSchemaUpdate(SpringProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);
        config.setFlowable5CompatibilityEnabled(true);
        config.setFlowable5CompatibilityHandler(flowable5CompatibilityHandler);
        return config;
    }

    @Bean
    public RuntimeService runtimeService(ProcessEngineFactoryBean processEngine) throws Exception {
        return processEngine.getObject().getRuntimeService();
    }
}

```

Any suggestions on how to resolve this issue? Are there additional steps I should take to ensure full compatibility and proper functioning of Flowable services?

* * *

Any help or guidance would be greatly appreciated. Thanks in advance!

---

<div class="post-metadata">

**Author:** ![filiphr](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/filiphr/32/315_2.png) [@filiphr](https://forum.flowable.org/u/filiphr)\
**Post date:** [July 19, 2024, 7:52am UTC](https://forum.flowable.org/t/failed-to-instantiate-flowable-engine-runtimeservice-migration-from-activiti-5-to-flowable-6/11646/2 "2024-07-19T07:52:17Z")

</div>

Hey @Otto,

The reason why you are seeing that error is due to the fact that you are using `DefaultFlowable5CompatibilityHandler `, which only supports the `StandaloneProcessEngineConfiguration`. You should instead use `SpringFlowable5CompatibilityHandlerFactory`.

Cheers,  
Filip

---

<div class="post-metadata">

**Author:** ![Otto](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/otto/32/3533_2.png) [@Otto](https://forum.flowable.org/u/Otto)\
**Post date:** [July 19, 2024, 8:36am UTC](https://forum.flowable.org/t/failed-to-instantiate-flowable-engine-runtimeservice-migration-from-activiti-5-to-flowable-6/11646/3 "2024-07-19T08:36:01Z")

</div>

> [@filiphr](#):
>
> `SpringFlowable5CompatibilityHandlerFactory`.

Thank you 🙂
