At bootstrap an eca definition like the following:
<eca entity="JobSandbox" operation="store" event="validate">
<action service="ping" mode="sync"/>
</eca>
is causing a deadlock because it is triggered at startup when the reloadCrashedJobs method is executed; reloadCrashedJobs is executed holding a lock on the JobManager object; within this method a "find" operation is performed that (because of the "validate" event) triggers the action; but for this a getDispatchContext is executed and this blocks until the task (executed by a thread Executor) that reads and setups the eca rules is complete; but this task requires a lock on the same JobManager object and thus we get the deadlock
Thanks to Arun Patidar and Deepak Dixit for analyzing the issue with me.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1655046 13f79535-47bb-0310-9956-ffa450edef68