I’m trying to configure flowable-rest(v6) to use JNDI with Tomcat server similar to Flowable UI applications.
Unzipped flowable-rest.war, but I couldn’t find any files like ‘flowable-ui-app.properties’ in flowable-rest app.
Which file do I have to edit?
The exposed properties for the Flowable REST APP are in db.properties and in engine.properties.
But these don’t allow you to configure the datasource for JDNI.
The REST APP contains a flowable-custom-context.xml file.
With this you can have full control on configuring the Spring context.
Yes, I’ve tried to edit flowable-custom-context.xml file.
First I uncommented the all comments in this file, and modified ‘dataSource’ bean tag as below.
(Of course jdbc/flowableDB is prepared in tomcat server setting)
Once I reboot tomcat server, then I could find some demo-user records (such as fozzie or kermit…) were inserted into ACT_ID_USER table of ‘jdbc/flowableDB’. So I was sure flowable has been able to lookup JNDI.
But badly I saw some errors occured, while server starting up, and flowable-rest instance was force removed by tomcat server.(maybe destroyd as soon as it added demo data to DB…)
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘formRepositoryService’ defined in class path resource [org/flowable/rest/conf/FlowableEngineConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.flowable.form.api.FormRepositoryService]: Factory method ‘formRepositoryService’ threw exception; nested exception is java.lang.ClassCastException: org.flowable.spring.ProcessEngineFactoryBean$$EnhancerBySpringCGLIB$$d4574dac cannot be cast to org.flowable.engine.ProcessEngine
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599) …
I can’t understand this error message, but I think there is something wrong with ‘flowable-custom-context.xml’ file it’self.
(because of I did nothing special except modifying ‘dataSource’ bean tag as above)
You’re correct. The commented out section is not updated with the latest way to initialize the separate engines (dmn, form and content) and inject them into the process engine.
Yes. Currently this is the case. When you don’t use the property files to configure the application, but use your own context configuration you have to recompile and build your war.
I’ll have a look to see if it’s feasible to have the jndi setting exposed in the property file.
You don’t need to remove the @Configuration annotation of the FlowableEngineConfiguration class.
With the id change all the beans from the Java configuration class get overwritten by the context-xml.
I tried and made sure that all the beans were overridden by definitions in the context file, without removing the @Configuration annotation from the java config class.
Hi. The suggested config and removal @Configuration doesn’t work me (Flowable 6.2.1). I’m getting:
2018-03-11 23:59:22.817:WARN:oejw.WebAppContext:main: Failed startup of context o.e.j.w.WebAppContext@7e0b0338{/flowable-rest,file:///tmp/jetty-0.0.0.0-8080-flowable-rest.war-_flowable-rest-any-650093855466802180.dir/webapp/,UNAVAILABLE}{/var/tmp/flowable-rest.war}
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘formRepositoryService’ defined in class path resource [flowable-custom-context.xml]: No matching factory method found: factory bean ‘processEngine’; factory method ‘getFormEngineRepositoryService()’. Check that a method with the specified name exists and that it is non-static.