Error in process-instances API

I am using the below process-instances API
flowable-rest/service/runtime/process-instances

input :
{“processDefinitionId”:“123”,“processDefinitionKey”:“processTwo”}

error :
{
“message”: “Bad request”,
“exception”: “Only one of processDefinitionId, processDefinitionKey or message should be set.”
}

Please help is in this

Hi Nihar.

When starting a process instance only one of processDefinitionId, processDefinitionKey or message can be used in the request body.

Take a look at this section in the REST API documentation .

Thanks for your response…
I have one issue
In the flowable-rest war file ,we want to modify the default DB configuration

default
db=h2
jdbc.driver=org.h2.Driver
jdbc.url=jdbc:h2:mem:activiti;DB_CLOSE_DELAY=-1
jdbc.username=sa
jdbc.password=

new configuration
db=flowable
jdbc.driver=org.postgresql.Driver
jdbc.url=postgresql://localhost:5432/flowable
jdbc.username=postgres
jdbc.password=

We are getting error as “Driver must not be null”

Please verify the above DB configuration and let us know if changes required

Couple of things seem wrong with your DB config.

db=flowable; this should be the database type; in your case; postgres

jdbc.url=postgresql://localhost:5432/flowable; this isn’t a correct jdbc url.It should start with jdbc:

updated DB config

db=postgres
jdbc.driver=org.postgresql.Driver
jdbc.url=jdbc://localhost:5432/flowable
jdbc.username=postgres
jdbc.password=

SEVERE: Exception sending context destroyed event to listener instance of class org.activiti.rest.servlet.WebConfigurer
java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
at org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext(WebApplicationContextUtils.java:83)
at org.activiti.rest.servlet.WebConfigurer.contextDestroyed(WebConfigurer.java:92)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:5146)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5810)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:224)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:159)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1092)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1984)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Hi,

Can you please post the full error log? Because there should be more information in the log file.

Best regards,

Tijs

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.activiti.engine.ProcessEngine]: Factory method ‘processEngine’ threw exception; nested exception is java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘processEngineFactoryBean’: FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: Driver must not be null
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
… 60 more
Caused by: java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘processEngineFactoryBean’: FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: Driver must not be null
at org.activiti.rest.conf.ActivitiEngineConfiguration.processEngine(ActivitiEngineConfiguration.java:84)
at org.activiti.rest.conf.ActivitiEngineConfiguration$$EnhancerBySpringCGLIB$$f2cb2f72.CGLIB$processEngine$6()
at org.activiti.rest.conf.ActivitiEngineConfiguration$$EnhancerBySpringCGLIB$$f2cb2f72$$FastClassBySpringCGLIB$$a54cc113.invoke()
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:309)
at org.activiti.rest.conf.ActivitiEngineConfiguration$$EnhancerBySpringCGLIB$$f2cb2f72.processEngine()
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
… 61 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘processEngineFactoryBean’: FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: Driver must not be null
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:175)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:103)
at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1517)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:251)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor$1.intercept(ConfigurationClassEnhancer.java:379)
at org.activiti.spring.ProcessEngineFactoryBean$$EnhancerBySpringCGLIB$$f163bab2.getObject()
at org.activiti.rest.conf.ActivitiEngineConfiguration.processEngine(ActivitiEngineConfiguration.java:82)
… 71 more
Caused by: java.lang.IllegalArgumentException: Driver must not be null
at org.springframework.util.Assert.notNull(Assert.java:112)
at org.springframework.jdbc.datasource.SimpleDriverDataSource.getConnectionFromDriver(SimpleDriverDataSource.java:136)
at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver(AbstractDriverBasedDataSource.java:155)
at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnection(AbstractDriverBasedDataSource.java:120)
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111)
at org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(TransactionAwareDataSourceProxy.java:225)
at com.sun.proxy.$Proxy44.getMetaData(Unknown Source)
at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initDatabaseType(ProcessEngineConfigurationImpl.java:859)
at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initDataSource(ProcessEngineConfigurationImpl.java:808)
at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.init(ProcessEngineConfigurationImpl.java:624)
at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:612)
at org.activiti.spring.SpringProcessEngineConfiguration.buildProcessEngine(SpringProcessEngineConfiguration.java:65)
at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:60)
at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:32)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:168)
… 78 more

Nov 10, 2016 5:28:10 PM org.apache.catalina.core.StandardContext listenerStop
SEVERE: Exception sending context destroyed event to listener instance of class org.activiti.rest.servlet.WebConfigurer
java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
at org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext(WebApplicationContextUtils.java:83)
at org.activiti.rest.servlet.WebConfigurer.contextDestroyed(WebConfigurer.java:92)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:5146)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5810)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:224)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:159)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1092)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1984)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Ok thanks, I think the jdbc url is incorrect. It should be like this:

db=postgres
jdbc.driver=org.postgresql.Driver
jdbc.url=jdbc:postgresql://localhost:5432/flowable
jdbc.username=postgres
jdbc.password=

Best regards,

Tijs

db=postgres
jdbc.driver=org.postgresql.Driver
jdbc.url=jdbc:postgresql://localhost:5432/flowable
jdbc.username=postgres
jdbc.password=

I have modified the DB config as you said,but error is still the same.

It’s still “java.lang.IllegalArgumentException: Driver must not be null” ?
Do you have the postgres library on the classpath?
Is the postgres database ‘flowable’ created?

Best regards,

Tijs

yes database ‘flowable’ is already created…
postgres library in which classpath? i am using existing flowable-rest.war and making changes in DB.properties file.

Ok, on the classpath of the servlet container or the flowable rest app you are running.
The Postgres driver is not in the flowable rest web app (WEB-INF/lib), so you need to copy it to the WEB-INF/lib folder.
For example the MySQL driver is not allowed to be distributed, so we can’t just include all db drivers in the web applications.

Best regards,

Tijs

I have the similar problem.
I configurate the files of flowable:

  1. …/tomcat/webapps/flowable-rest/WEB-INF/classes/db.properties
    db=postgres
    datasource.driver=org.postgresql.Driver
    datasource.url=jdbc:postgresql://localhost:5432/flowable
    datasource.username=flowable
    datasource.password=*******

  2. …/tomcat/webapps/flowable-admin/WEB-INF/classes/META-INF/flowable-admin-app/flowable-admin-app.properties
    …/tomcat/webapps/flowable-idm/WEB-INF/classes/META-INF/flowable-idm-app/flowable-idm-app.properties
    …/tomcat/webapps/flowable-task/WEB-INF/classes/META-INF/flowable-app/flowable-task-app.properties
    …/tomcat/webapps/flowable-modeler/WEB-INF/classes/META-INF/flowable-modeler-app/flowable-modeler-app.properties

datasource.driver=org.postgresql.Driver
datasource.url=jdbc:postgresql://localhost:5432/flowable
datasource.username=flowable
datasource.password=*******

I have copy the postgresql-9.4.1212.jar to all folders …/WEB-INF/lib

And show message “Invalid credentials” in the login.
In table “act_id_user” have the kermit, gonzo and fozzie users.

OBS: I use the tomcat and postgresql of Alfresco instalation.

Hi,

How did you create the kermit, gonzo and fozzie users?
In which app do you get the invalid credentials message on login?

Best regards,

Tijs

I create the database “flowable” in postgres and restart tomcat. The users was created automatically in tomcat start.
The message is show in app "flowable-idm"
Is necessary configure the postgres in 5 apps (flowable-admin/idm/task/modeler/rest)?

It’s best to only start the flowable-admin, flowable-idm, flowable-task and flowable-modeler apps on the same Tomcat server. Don’t include the flowable-rest webapp, because this is already included in the flowable-task app. Start with a clean database and then login with admin/test. That should work.

Best regards,

Tijs

I followed the steps:

  1. I downloaded Flowable 6.0.0.RC1, copied the files
    flowable-admin.war, flowable-idm.war, flowable-modeler.war, and
    flowable-task.war to the / tomcat / webapps folder.
  2. I created the ‘flowable’ database in Postgresql with Superuser permission.
  3. I edited the files:
  • /tomcat/webapps/flowable-admin/WEB-INF/classes/META-INF/flowable-admin-app/flowable-admin-app.properties
  • /tomcat/webapps/flowable-idm/WEB-INF/classes/META-INF/flowable-idm-app/flowable-idm-app.properties
  • /tomcat/webapps/flowable-task/WEB-INF/classes/META-INF/flowable-app/flowable-task-app.properties
  • tomcat / webapps / flowable-modeler / WEB-INF / classes / META-INF / flowable-modeler-app / flowable-modeler-app.properties

Change the values ​​to:
Datasource.driver = org.postgresql.Driver
Datasource.url = jdbc: postgresql: // localhost: 5432 / flowable
Datasource.username = flowable
Datasource.password = ******

  1. I downloaded the latest jdbc driver from postgresql
    (postgresql-9.4.1212.jar) and copied it to the / WEB-INF / lib / folder
    of all apps.

It did not work by following these steps. Continue to authenticate with the user ‘admin’ and password ‘test’ H2.

Should I create the $ CATALINA_BASE / conf / Catalina / localhost / flowable-app.xml file as described in the manual?

I need change the pom.xml file? That only have profiles to ‘h2mem’ and ‘mysql’?

Hi,

It’s difficult to say much without more details than “It did not work by following these steps…”.
The steps your are describing look fine to me and should work.
Do you see any error message in the Tomcat log files?

Best regards,

Tijs

I already solved the problem.
I believe it was permission in the default schema of postgresql.
thank you

I followed the steps:

I downloaded Flowable 6.0.0.RC1, copied the files
flowable-admin.war, flowable-idm.war, flowable-modeler.war, and
flowable-task.war to the / tomcat / webapps folder.
I created the ‘flowable’ database in Postgresql with Superuser permission.
I edited the files:
/tomcat/webapps/flowable-admin/WEB-INF/classes/META-INF/flowable-admin-app/flowable-admin-app.properties
/tomcat/webapps/flowable-idm/WEB-INF/classes/META-INF/flowable-idm-app/flowable-idm-app.properties
/tomcat/webapps/flowable-task/WEB-INF/classes/META-INF/flowable-app/flowable-task-app.properties
tomcat / webapps / flowable-modeler / WEB-INF / classes / META-INF / flowable-modeler-app / flowable-modeler-app.properties

To connect to the MSSQL database but i am getting error like this can you help ,me with that

WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source’ to ‘org.eclipse.jst.jee.server:flowable-admin’ did not find a matching property.
Jan 04, 2018 2:07:39 PM org.apache.catalina.startup.VersionLoggerListener log