if we install “bahmni-offline-sync” component (does not matter if you do install event-log-service or not), openmrs fails to startup
on debugging, it was found that bahmni-offline-sync omod is built from 0.91 branch of the repo for bahmni v0.92 release
building and using from master, results in same problem
the issue is while loading the “platformtransactionManager” from openmrs context
the core reason is that, we are trying to lookup the PlatfromTransactionManager from Context.getRegisteredComponent() .. where the spring context is not fully loaded.
resolution
lazy load the “PlatformTransactionManager”, meaning load it only when it is needed, not at the time of initialization of a class. Especially a class, which is not loaded by spring context (since Context is a static openmrs class and hence any method is invokable at any pt in time)
Test:
Create the OMOD
Manual: in the server, replace the “/opt/openmrs/module/bahmniOfflineSync-0.91-SNAPSHOT.omod” with the “bahmniOfflineSync-0.92-SNAPSHOT.omod”
During installation, this can be simulated as well by specifying certain properties in the “/etc/bahmni-installer/setup.yml”
omods:
- url: file:/tmp/
modules: bahmniOffSync-0.92-SNAPSHOT.omod
PR: