# Multi tenancy ebabled Event Registry causes Exception while startup

**URL:** <https://forum.flowable.org/t/multi-tenancy-ebabled-event-registry-causes-exception-while-startup/7442>\
**Category:** Flowable Engine\
**Created:** [February 2, 2021, 1:26pm UTC](https://forum.flowable.org/t/multi-tenancy-ebabled-event-registry-causes-exception-while-startup/7442 "2021-02-02T13:26:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tina.bandalo](https://avatars.discourse-cdn.com/v4/letter/t/f0a364/32.png) [@tina.bandalo](https://forum.flowable.org/u/tina.bandalo)\
**Post date:** [February 2, 2021, 1:26pm UTC](https://forum.flowable.org/t/multi-tenancy-ebabled-event-registry-causes-exception-while-startup/7442/1 "2021-02-02T13:26:16Z")

</div>

In a multi tenancy environment we are using flowable 6.6.0 and setDisabledEventRegistry(false). We have an error while start up in multi-tenancy because it accessed the tenant schema before it was initialized. Any idea how to fix that?

org.flowable.common.engine.api.FlowableException: Could not find a dataSource for tenant  
at org.flowable.common.engine.impl.cfg.multitenant.TenantAwareDataSource.getCurrentDataSource(TenantAwareDataSource.java:68)  
at org.flowable.common.engine.impl.cfg.multitenant.TenantAwareDataSource.getConnection(TenantAwareDataSource.java:56)  
at org.apache.ibatis.transaction.jdbc.JdbcTransaction.openConnection(JdbcTransaction.java:139)  
at org.apache.ibatis.transaction.jdbc.JdbcTransaction.getConnection(JdbcTransaction.java:61)  
at org.apache.ibatis.session.defaults.DefaultSqlSession.getConnection(DefaultSqlSession.java:297)  
at org.flowable.common.engine.impl.db.DbSqlSessionFactory.openSession(DbSqlSessionFactory.java:96)  
at org.flowable.common.engine.impl.interceptor.CommandContext.getSession(CommandContext.java:265)  
at org.flowable.common.engine.impl.cfg.standalone.StandaloneMybatisTransactionContext.(StandaloneMybatisTransactionContext.java:48)  
at org.flowable.common.engine.impl.cfg.standalone.StandaloneMybatisTransactionContextFactory.openTransactionContext(StandaloneMybatisTransactionContextFactory.java:26)  
at org.flowable.common.engine.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:47)  
at org.flowable.common.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:83)  
at org.flowable.common.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)  
at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)  
at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51)  
at org.flowable.common.engine.impl.query.AbstractQuery.list(AbstractQuery.java:117)  
at org.flowable.eventregistry.impl.EventRegistryEngineImpl.handleDeployedChannelDefinitions(EventRegistryEngineImpl.java:68)  
at org.flowable.eventregistry.impl.EventRegistryEngineConfiguration.buildEventRegistryEngine(EventRegistryEngineConfiguration.java:195)  
at org.flowable.eventregistry.impl.configurator.EventRegistryEngineConfigurator.initEventRegistryEngine(EventRegistryEngineConfigurator.java:87)  
at org.flowable.eventregistry.impl.configurator.EventRegistryEngineConfigurator.configure(EventRegistryEngineConfigurator.java:64)  
at org.flowable.common.engine.impl.AbstractEngineConfiguration.configuratorsAfterInit(AbstractEngineConfiguration.java:1036)  
at org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl.init(ProcessEngineConfigurationImpl.java:1090)  
at org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:980)  
at org.flowable.engine.impl.cfg.multitenant.MultiSchemaMultiTenantProcessEngineConfiguration.buildProcessEngine(MultiSchemaMultiTenantProcessEngineConfiguration.java:126)  
at com.sap.bpm.wfs.activiti.MultiTenantHANAProcessEngineConfiguration.buildProcessEngine(MultiTenantHANAProcessEngineConfiguration.java:50)  
at com.sap.bpm.wfs.comp.activiti.MultiTenantHANAProcessEngineConfigurationTest.setUp(MultiTenantHANAProcessEngineConfigurationTest.java:38)  
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)  
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
at java.lang.reflect.Method.invoke(Method.java:498)

---

<div class="post-metadata">

**Author:** ![tina.bandalo](https://avatars.discourse-cdn.com/v4/letter/t/f0a364/32.png) [@tina.bandalo](https://forum.flowable.org/u/tina.bandalo)\
**Post date:** [February 4, 2021, 9:38am UTC](https://forum.flowable.org/t/multi-tenancy-ebabled-event-registry-causes-exception-while-startup/7442/2 "2021-02-04T09:38:56Z")

</div>

not sure if related but it is a multi tenant multi schema environment.

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [February 8, 2021, 12:47pm UTC](https://forum.flowable.org/t/multi-tenancy-ebabled-event-registry-causes-exception-while-startup/7442/3 "2021-02-08T12:47:12Z")

</div>

That’s strange - cause in the stacktrace this happens in the ‘afterInit’. Can you share how you’re setting up the tenants (i.e. what is “MultiTenantHANAProcessEngineConfiguration”)?
