I want to use the form engine. However, the following call is returning null. FormEngine formEngine = (FormEngine) FormEngines.getDefaultFormEngine();
I created a configuration file named flowable.form.cfg.xml as explained in the documentation. I don’t know what I’m doing wrong. I did the same to get the default process engine and everything worked as expected.
11:02:28,205 [main] ERROR org.flowable.form.engine.FormEngines - Exception while initializing form engine: liquibase/database/DatabaseConnection
java.lang.NoClassDefFoundError: liquibase/database/DatabaseConnection
at org.flowable.form.engine.FormEngines.buildFormEngine(FormEngines.java:163)
at org.flowable.form.engine.FormEngines.initFormEngineFromResource(FormEngines.java:144)
at org.flowable.form.engine.FormEngines.init(FormEngines.java:76)
at org.flowable.form.engine.FormEngines.getFormEngine(FormEngines.java:198)
at org.flowable.form.engine.FormEngines.getDefaultFormEngine(FormEngines.java:187)
at org.flowable.CallForForecasts.main(CallForForecasts.java:17)
Caused by: java.lang.ClassNotFoundException: liquibase.database.DatabaseConnection
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 6 more
Previously I had another error:
11:08:01,036 [main] ERROR org.flowable.form.engine.FormEngines - Exception while initializing form engine: org/apache/commons/io/IOUtils
java.lang.NoClassDefFoundError: org/apache/commons/io/IOUtils
Thanks @tijs, the dependency solved the error. However, now I had another one:
11:15:54,120 [main] ERROR org.flowable.form.engine.FormEngines - Exception while initializing form engine: Error initialising form data schema
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 org.flowable.form.engine.FormEngines.buildFormEngine(FormEngines.java:164)
at org.flowable.form.engine.FormEngines.initFormEngineFromResource(FormEngines.java:144)
at org.flowable.form.engine.FormEngines.init(FormEngines.java:76)
at org.flowable.form.engine.FormEngines.getFormEngine(FormEngines.java:198)
at org.flowable.form.engine.FormEngines.getDefaultFormEngine(FormEngines.java:187)
at org.flowable.CallForForecasts.main(CallForForecasts.java:17)
Caused by: liquibase.exception.ChangeLogParseException: Error Reading Migration File: Found 3 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)
... 8 more
Caused by: java.io.IOException: Found 3 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)
... 15 more
I read in a post a similar situation but I don’t know it was finally solved. I checked the flowable-form-db-changelog.xml and in effect, there are 3 files with this name (I’m working with version 6.2.0).
Having this file 3 times on the classpath should not be possible when the dependencies are set correctly.
Could you share the dependencies of your project? Are you using Maven?
Yes, I’m using Maven. I think that the files repetition is related to a problem that I had when I cloned the project. I’m working to solve this. In my project the only dependencies that I have are the following:
I didn’t resolve it yet. I thought that I made something wrong when I build Flowable engine in Eclipse so I build it again but the error is the same (Error Reading Migration File).
I’m working to solve it, when I had any news I will update the post.
Hi,
I solved the error. The problem was that I imported JARs that were already available in the Maven Dependencies, so I just needed to remove these JARs.