Migrating emrapi module from GlobalProperties to metadata mappings

@raff do you have any idea why https://qa-refapp.openmrs.org/openmrs/owa/metadatamapping/index.html is still not working despite the fact that the server has the updated module?

I have used the same module locally and on other servers like modules-refapp.openmrs.org which confirmed that your changes fixed the reported problem. So why not on qa-refapp? :slight_smile:

FWIW, i did a sanity check with this commit which got reflected on this server as i expected to confirm that it is running the latest commit: https://github.com/openmrs/openmrs-module-metadatamapping/commit/9f7f5ca4454815f64df77d3a23a34de3d4aedbc6

I noticed the concept dictionary app doesnā€™t work as well and OWA module is reporting no apps at https://qa-refapp.openmrs.org/openmrs/module/owa/manage.form

Iā€™ll have another look.

So far I donā€™t know what is happening. At least I narrowed down the issue to metadatamapping owa and conceptidictionary starts correctly.

Hereā€™s the error from qa-refapp:

ERROR - OwaActivator.contextRefreshed(115) |2017-07-06 13:16:16,287| Failed to deploy OWA from zip file: metadatamapping.owa
java.lang.NullPointerException
        at java.io.Reader.<init>(Reader.java:78)
        at java.io.InputStreamReader.<init>(InputStreamReader.java:72)
        at org.apache.commons.io.IOUtils.copy(IOUtils.java:1049)
        at org.apache.commons.io.IOUtils.toString(IOUtils.java:359)
        at org.openmrs.module.owa.impl.DefaultAppManager.installApp(DefaultAppManager.java:95)
        at org.openmrs.module.owa.activator.OwaActivator.contextRefreshed(OwaActivator.java:110)
        at org.openmrs.module.ModuleUtil.refreshApplicationContext(ModuleUtil.java:877)
        at org.openmrs.module.web.WebModuleUtil.refreshWAC(WebModuleUtil.java:866)
        at org.openmrs.web.Listener.performWebStartOfModules(Listener.java:658)
        at org.openmrs.web.Listener.performWebStartOfModules(Listener.java:637)
        at org.openmrs.web.Listener.startOpenmrs(Listener.java:268)
        at org.openmrs.web.WebDaemon$1.run(WebDaemon.java:42)

It seems like an issue with reading manifest.webapp from the zip file, but itā€™s really hard to tell what is causing it. I couldnā€™t reproduce it locally even running in dockerā€¦ @dkayiwa, maybe you could spot whereā€™s the issue. I must be missing something.

@raff just off the head, do you think this could be among the causes? https://github.com/openmrs/openmrs-module-owa/pull/50

Yeah, that was my first guess so I reverted it, but it still didnā€™t work.

@dkayiwa, I found the issue. Maven behaved inconsistently on CI and locally. Fixed in https://github.com/openmrs/openmrs-module-metadatamapping/commit/fe6d5a1d3e163492575e734fed0967d5d9e2e2e4

Excellent! :smile: