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?