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
Nothing more specific? really hard to figure out what the problem is and where to start looking, off course…

jom_santos
Champ in-the-making
Champ in-the-making
Maybe you can help me if you have a general look of the system I'm talking about.

I have a Liferay Portal application running on a Tomcat server.
Adding to it, I have several portlets running in Liferay Portal, which use a set of shared Liferay services.
Those services are reachable through a jar file.

I also have a servlet running in that Tomcat using the Liferay services, which cause access conflits if the services.jar file is in the portlet lib folder (in which it was originally).
In order to solve those conflits I put the jar file in the Tomcat lib/ext folder.

Then I tried to integrate the Activiti engine with the Liferay Portal application, building my own interface to manage processes.
I put the activiti-engine-5.10.jar in the portlet WEB-INF/lib folder and the activiti.cfg.xml file in the WEB-INF/src folder and all was working fine until I needed to develop new Liferay services using Activiti classes.
Then I realized that the activiti-engine-5.10.jar file needed to be in the Tomcat lib/ext folder, because of the dependencies with the Liferay services jar.

With the activiti-engine-5.10.jar in Tomcat lib/ext folder I tried several ways to initialize the engine:
(1) - using activiti.cfg.xml in the portlet WEB-INF/src folder - obs: I don't know, since I moved the activiti-engine-5.10.jar if this file is in the right folder or if there's anything else I need to do;
(2) - using the Java API's ( createStandaloneProcessEngine().buildProcessEngine() ), specifying the JDBC properties and ignoring any configuration file; this code is present in a ServletContextListener, which is declared in the portlet web.xml file.´

Both ways didn't work for me:
(1) - The method ProcessEngines.init() does not throw an exception, but I get a NullPointerException as soon as call the method ProcessEngines.getDefaultProcessEngine(), which mean that either that the application can't find the activiti.cfg.xml file (perhaps it needed to be elsewhere) or that there's another error preventing the engine to run as it should;
(2) - I don't get any kind of exception, on the log of Tomcat I get the message SEVERE: Error listenerStart, and with some debug I found that the code after the creation of the ProcessEngineConfiguration isn't executed.

If you have any doubt let me know.

Off-topic: from what I saw in your source code I suppose that the method createStandaloneProcessEngine() should throw an ActivitiException. I've noticed this does not happen in the BPMN XML parser. Is it possible that we are unable to catch any ActivitiException at all?

frederikherema1
Star Contributor
Star Contributor
1) The activiti.cfg.xml file should be on your class path… WEB-INF/classes is one of the locations that is part of the class path. WEB-INF/src IS NOT.
2) There must be an exception thrown in the ProcessEngineConfiguration.buildProcessEngine(). have you found out what exception yet?

jom_santos
Champ in-the-making
Champ in-the-making
(1) - tried, no different result.
(2) - there's no exception, I only got printed in the log of the server SEVERE: Error listenerStart. so far I was not able to catch any ActivitiException, like I say about the XML parser.

jbarrez
Star Contributor
Star Contributor
Did you also try WEB-INF/lib. I've found that /classes doesn't always work on some tomcats.