We're updating the issue view to help you get more done. 

Bahmni-erp-connect: Integration between MRS-ERP fails if Lab Component is not installed

Description

With Bahmni 0.92, during installation, if Lab Component was not chosen, then bahmni-erp-connect fails to start.
Talk thread: https://talk.openmrs.org/t/announcing-bahmni-0-92-release-candidate/23758/13

The error reported in bahmni-erp-connect.log is as below
<pre>
Unsatisfied dependency expressed through constructor argument with index 2 of type [org.bahmni.openerp.web.OpenERPProperties]: : Error creating bean with name 'openERPAtomFeedProperties': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.lang.String org.bahmni.feed.openerp.OpenERPAtomFeedProperties.elisSaleOrderFeedUri; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'openelis.saleorder.feed.generator.uri' in string value "${openelis.saleorder.feed.generator.uri}";
</pre>

Analysis:
This is because while the properties file is being overwritten based on the selected component, some of the attributes are not based on condition whether the lab component is selected or not.

Note the line in the bahmni-playbooks's jinja template: https://github.com/Bahmni/bahmni-playbooks/blob/master/roles/bahmni-erp-connect/templates/erp-atomfeed.properties.j2#L36

Solution:
in "openerp-atomfeed-service" codebase, the autoinjection of properties using @value for org.bahmni.feed.openerp.OpenERPAtomFeedProperties should have a default "blank space".

@Value("${openelis.saleorder.feed.generator.uri:''}")

Same should be the case for other '@value' injections for
openelis.user
openelis.password
openelis.uri
openelis.saleorder.feed.generator.uri

Status

Assignee

Angshuman Sarkar

Reporter

chine zoheir

Labels

None

Units

None

PercentDone

None

DueTime

None

Clients

None

External issue ID

None

UAT Assignee

Sravya Kanagarla

Reviewer

None

Components

Sprint

Fix versions