cancel
Showing results for 
Search instead for 
Did you mean: 

Engine Configuration

jom_santos
Champ in-the-making
Champ in-the-making
I've a app develop using Liferay in a Tomcat server. I configured Activiti engine using *.cfg.xml file, with the engine jar in the specific portlet lib folder. But now I need to run the engine in the Tomcat lib/ext folder and I can't get access to the *.cfg.xml and if I try to create a Standalone Process Engine Configuration object (in order to config the engine) nothing works. Is there something I need to do?
14 REPLIES 14

frederikherema1
Star Contributor
Star Contributor
Where are you creating your process-engine? Make sure the class loader that loads that specific part of code, has access to the activiti.cg.xml location on the class path.

jom_santos
Champ in-the-making
Champ in-the-making
I create my ProcessEngine in a ServletContextListener and the activiti engine jar is in the Tomcat lib/ext folder. Where should I place the *cfg.xml file?

frederikherema1
Star Contributor
Star Contributor
Perhaps WEB-INF/classes, this is always on you're class path. Usually, the config is app-specific and is a logical place to be…

jom_santos
Champ in-the-making
Champ in-the-making
Putting the file doesn't make difference, I still can't init the engine.

On other side, when I try to init the engine without the *cfg.xml file, my code stops here:
ProcessEngine processEngine = ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration();

Is there something I need to do?

iam
Champ in-the-making
Champ in-the-making
@jom: Why you don't use activiti-web plugin for Liferay?
http://www.emforge.net/web/activiti-liferay

frederikherema1
Star Contributor
Star Contributor
The createStandaloneProcess…. still requires you to set the JDBC-properties and call .buildProcessEngine() afterwards to actually build it. Alternatively, use createStandaloneInMemProcessEngineConfiguration() to have it initialize an in-memory H2.

jom_santos
Champ in-the-making
Champ in-the-making
Putting the file doesn't make difference, I still can't init the engine.

On other side, when I try to init the engine without the *cfg.xml file, my code stops here:
ProcessEngine processEngine = ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration();

Is there something I need to do?

Obviously i meant :
ProcessEngineConfiguration engineConf = ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration();
My code doesn't work past that, which mean that I can't even create the ProcessEngineConfiguration object (after create the "engineConf" object I try to configure the JDBC properties,, call buildProcessEngine() and then register that engine). Using createStandaloneInMemProcessEngineConfiguration() does not solve my problem cause we need to use MySQL databases. Is there anymore advises you can give me?

frederikherema1
Star Contributor
Star Contributor
Can you be a bit more specific than "My code doesn't work past that"? Is the thread blocked? What exception do you see?

jom_santos
Champ in-the-making
Champ in-the-making
I can't catch any exception. Since I run that code in a ServletContextListener, declared in the web.xml file, I got this error SEVERE: Error listenerStart.