# Form engine not initialized error

**URL:** <https://forum.flowable.org/t/form-engine-not-initialized-error/1143>\
**Category:** Flowable Engine\
**Created:** [November 2, 2017, 9:59am UTC](https://forum.flowable.org/t/form-engine-not-initialized-error/1143 "2017-11-02T09:59:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![shweta](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/shweta/32/360_2.png) [@shweta](https://forum.flowable.org/u/shweta)\
**Post date:** [November 2, 2017, 9:59am UTC](https://forum.flowable.org/t/form-engine-not-initialized-error/1143/1 "2017-11-02T09:59:25Z")

</div>

Hi everyone  
I am facing an issue with form engine. I am trying to start a form engine , as i want to fill a form programmatically, associated with a task of a process. I use following line of code to build the form engine :  
FormEngine formEngine = FormEngines.getDefaultFormEngine();

But when i run the code, i am facing error that form engine is not initialized. What does this mean and how to resolve it. Could anyone help. Thanks in advance. I have pasted below the error thrown on execution :

Exception in thread “main” org.flowable.engine.common.api.FlowableIllegalArgumentException: Form engine is not initialized  
at org.flowable.engine.impl.cmd.CompleteTaskWithFormCmd.execute(CompleteTaskWithFormCmd.java:72)  
at org.flowable.engine.impl.cmd.CompleteTaskWithFormCmd.execute(CompleteTaskWithFormCmd.java:38)  
at org.flowable.engine.impl.cmd.NeedsActiveTaskCmd.execute(NeedsActiveTaskCmd.java:58)  
at org.flowable.engine.impl.interceptor.CommandInvoker$1.run(CommandInvoker.java:51)  
at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:93)  
at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:72)  
at org.flowable.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:56)  
at org.flowable.engine.impl.interceptor.BpmnOverrideContextInterceptor.execute(BpmnOverrideContextInterceptor.java:25)  
at org.flowable.engine.common.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:53)  
at org.flowable.engine.common.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:72)  
at org.flowable.engine.common.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:36)  
at org.flowable.engine.common.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)  
at org.flowable.engine.common.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51)  
at org.flowable.engine.impl.TaskServiceImpl.completeTaskWithForm(TaskServiceImpl.java:230)  
at TestForm.main(TestForm.java:109)

---

<div class="post-metadata">

**Author:** ![tijs](https://avatars.discourse-cdn.com/v4/letter/t/bc79bd/32.png) [@tijs](https://forum.flowable.org/u/tijs)\
**Post date:** [November 2, 2017, 1:46pm UTC](https://forum.flowable.org/t/form-engine-not-initialized-error/1143/2 "2017-11-02T13:46:15Z")

</div>

Hi,

Because engines typically share the same database and transaction manager etc, we provide configurator classes to make this easy. There’s a FormEngineConfigurator (flowable-form-engine-configurator module) and SpringFormEngineConfigurator (flowable-form-spring-configurator module) class that do this. So you can do the following:

```
processEngineConfiguration.addConfigurator(new FormEngineConfigurator());

```

This will boot the form engine and make sure everything is properly configured and initialised.

Best regards,

Tijs

---

<div class="post-metadata">

**Author:** ![shweta](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/shweta/32/360_2.png) [@shweta](https://forum.flowable.org/u/shweta)\
**Post date:** [November 3, 2017, 5:57am UTC](https://forum.flowable.org/t/form-engine-not-initialized-error/1143/3 "2017-11-03T05:57:37Z")

</div>

Hi Tijs,  
I tried doing this way , but got error message:  
The method addConfigurator(FormEngineConfigurator) is undefined for the type ProcessEngineConfiguration

I am trying to instantiate flowable engine as follows :  
**FormEngine formEngine = formEngineConfiguration.buildFormEngine();**

and on execution , its giving following error which i am not able to understand or resolve :

INFO 3/11/17 10:38 AM: liquibase: Successfully acquired change log lock  
INFO 3/11/17 10:38 AM: liquibase: Successfully released change log lock  
Exception in thread “main” org.flowable.engine.common.api.FlowableException: **Error initialising form data schema**  
at org.flowable.form.engine.FormEngineConfiguration.initDbSchema(FormEngineConfiguration.java:305)  
at org.flowable.form.engine.FormEngineConfiguration.init(FormEngineConfiguration.java:191)  
at org.flowable.form.engine.FormEngineConfiguration.buildFormEngine(FormEngineConfiguration.java:174)  
at FormTesting.main(FormTesting.java:53)  
Caused by: **liquibase.exception.ChangeLogParseException: Error Reading Migration File: Found 2 files that match org/flowable/form/db/liquibase/flowable-form-db-changelog.xml**  
at liquibase.parser.core.xml.XMLChangeLogSAXParser.parseToNode(XMLChangeLogSAXParser.java:112)  
at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:17)  
at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:229)  
at liquibase.Liquibase.update(Liquibase.java:202)  
at liquibase.Liquibase.update(Liquibase.java:192)  
at liquibase.Liquibase.update(Liquibase.java:188)  
at liquibase.Liquibase.update(Liquibase.java:181)  
at org.flowable.form.engine.FormEngineConfiguration.initDbSchema(FormEngineConfiguration.java:299)  
… 3 more  
Caused by: **java.io.IOException: Found 2 files that match org/flowable/form/db/liquibase/flowable-form-db-changelog.xml**  
at liquibase.util.StreamUtil.singleInputStream(StreamUtil.java:205)  
at liquibase.parser.core.xml.XMLChangeLogSAXParser.parseToNode(XMLChangeLogSAXParser.java:93)  
… 10 more

---

<div class="post-metadata">

**Author:** ![tijs](https://avatars.discourse-cdn.com/v4/letter/t/bc79bd/32.png) [@tijs](https://forum.flowable.org/u/tijs)\
**Post date:** [November 3, 2017, 7:25am UTC](https://forum.flowable.org/t/form-engine-not-initialized-error/1143/4 "2017-11-03T07:25:47Z")

</div>

Hi Shweta,

Make sure that you cast the processEngineConfiguration variable to ProcessEngineConfigurationImpl. The addConfigurator is available there.

Best regards,

Tijs

---

<div class="post-metadata">

**Author:** ![shweta](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/shweta/32/360_2.png) [@shweta](https://forum.flowable.org/u/shweta)\
**Post date:** [November 3, 2017, 8:30am UTC](https://forum.flowable.org/t/form-engine-not-initialized-error/1143/5 "2017-11-03T08:30:27Z")

</div>

Hi Tijs,  
I tried casting this way :  
((ProcessEngineConfigurationImpl) processEngineConfiguration).addConfigurator(new FormEngineConfigurator());

Still throwing same error :

INFO 3/11/17 10:38 AM: liquibase: Successfully acquired change log lock  
INFO 3/11/17 10:38 AM: liquibase: Successfully released change log lock  
Exception in thread “main” org.flowable.engine.common.api.FlowableException: **Error initialising form data schema**  
at org.flowable.form.engine.FormEngineConfiguration.initDbSchema(FormEngineConfiguration.java:305)  
at org.flowable.form.engine.FormEngineConfiguration.init(FormEngineConfiguration.java:191)  
at org.flowable.form.engine.FormEngineConfiguration.buildFormEngine(FormEngineConfiguration.java:174)  
at FormTesting.main(FormTesting.java:53)  
Caused by: **liquibase.exception.ChangeLogParseException: Error Reading Migration File: Found 2 files that match org/flowable/form/db/liquibase/flowable-form-db-changelog.xml**  
at liquibase.parser.core.xml.XMLChangeLogSAXParser.parseToNode(XMLChangeLogSAXParser.java:112)  
at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:17)  
at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:229)  
at liquibase.Liquibase.update(Liquibase.java:202)  
at liquibase.Liquibase.update(Liquibase.java:192)  
at liquibase.Liquibase.update(Liquibase.java:188)  
at liquibase.Liquibase.update(Liquibase.java:181)  
at org.flowable.form.engine.FormEngineConfiguration.initDbSchema(FormEngineConfiguration.java:299)  
… 3 more  
Caused by: **java.io.IOException: Found 2 files that match org/flowable/form/db/liquibase/flowable-form-db-changelog.xml**  
at liquibase.util.StreamUtil.singleInputStream(StreamUtil.java:205)  
at liquibase.parser.core.xml.XMLChangeLogSAXParser.parseToNode(XMLChangeLogSAXParser.java:93)  
… 10 more

---

<div class="post-metadata">

**Author:** ![tijs](https://avatars.discourse-cdn.com/v4/letter/t/bc79bd/32.png) [@tijs](https://forum.flowable.org/u/tijs)\
**Post date:** [November 3, 2017, 8:38am UTC](https://forum.flowable.org/t/form-engine-not-initialized-error/1143/6 "2017-11-03T08:38:23Z")

</div>

Hi,

You have multiple org/flowable/form/db/liquibase/flowable-form-db-changelog.xml files on the classpath the error says. Maybe you can share your project, so I can try to reproduce.

Best regards,

Tijs

---

<div class="post-metadata">

**Author:** ![shweta](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/shweta/32/360_2.png) [@shweta](https://forum.flowable.org/u/shweta)\
**Post date:** [November 3, 2017, 8:43am UTC](https://forum.flowable.org/t/form-engine-not-initialized-error/1143/7 "2017-11-03T08:43:38Z")

</div>

Hi Tijs,  
Could you provide your email id so that i could share the project with you.

Thanks and regards  
Shweta P.

---

<div class="post-metadata">

**Author:** ![ZeyKon](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/zeykon/32/955_2.png) [@ZeyKon](https://forum.flowable.org/u/ZeyKon)\
**Post date:** [December 6, 2018, 10:18am UTC](https://forum.flowable.org/t/form-engine-not-initialized-error/1143/8 "2018-12-06T10:18:41Z")

</div>

真的谢谢你了！我也成功解决了这个问题！哈哈哈哈哈，万分感谢！
