@raff Please do help here, I have just noticed that the dashboard widgets do not seem to be working on https://qa-refapp.openmrs.org but no idea where to dig in
Okay, so it wasnāt what I though it was⦠I though it might have been due to a change I had to make to key used to specify the locale when fetching message codes RESTfully, but that all sees to be working okay.
Further testing shows that although ālocaleKey=enā is loading, the message keys returned are only those from OpenMRS Core (or at least the modules I spot-checked were missing).
Iām wondering if perhaps this initialization step that preloads all them message codes into a map didnāt pick up the module codes for some reason?
I was also wondering if this was perhaps a transitory thing⦠I didnāt know how to restart the refapp server, so retriggered the build, and it did appear to restart the server, but Iām still seeing the same problem.
Unfortunately, Iām not sure how to debug further⦠there certainly could be some issues in the code I wrote to load message maps (see above) but (so far, at least) things are working for me locally and on our bamboo pipeline⦠I think Iād need to able log into the qa-refapp server and perhaps run a debugger against it to test further.
Iāll continue to keep an eye to see if I can reproduce locally.
@ssmusoke⦠any idea if this problem just started to occur? Would be great if we could track it down to a certain commit or range of commits.
Cool, keep me posted and I can look into things⦠it could certainly be a symptom of my code but hard for me to debug since I canāt reproduce locally.
@mogoodrich a thought can you share the list of modules and their versions that you are running. That way I just look at the ones that are different in setups with the error.
Thanks @raff⦠though I donāt see the commit yet? (Iām curious because I suspect it was my fault and a problem with the MessagesController. Just hard for me to debug since I couldnāt reproduce).
I tracked it further down to be an issue in openmrs-core 2.0.x+. Basically messageSourceService.getPresentations() is not returning any messages from modules, however messageSourceService.getMessage(ā¦) does look up codes in modulesā messages (Iām guessing itās not using getPresentations()).
Basically findPropertiesFiles does not work for some reason. The implementation has been changed in openmrs-core 2.0.x entirely.
And, yeah, having it be a issue with Core does make sense, because it where the reference app differs most from the PIH EMR⦠we are still running 1.10.x Core in the PIH EMR.
@dkayiwa I identified the issue to be caused by TRUNK-4097. If you run RA 2.7.0-SNAPSHOT and go to the patient dashboard you will see ācoreapps.noneā message under Family even though the translation is defined in coreapps (itās loaded via a rest call to the uicommons/messages endpoint). The issue is with modifications you made to findPropertiesFiles, which returns only properties found in openmrs-core, but not in modules. I was looking for a way to fix it, but with no avail so far. Maybe, you could have a look as wellā¦
WARNING: Note that āclasspath*:ā when combined with Ant-style patterns will only work reliably with at least one root directory before the pattern starts, unless the actual target files reside in the file system. This means that a pattern like āclasspath*:*.xmlā will not retrieve files from the root of jar files but rather only from the root of expanded directories. This originates from a limitation in the JDKās ClassLoader.getResources() method which only returns file system locations for a passed-in empty String (indicating potential roots to search). This ResourcePatternResolver implementation is trying to mitigate the jar root lookup limitation through URLClassLoader introspection and ājava.class.pathā manifest evaluation; however, without portability guarantees.
Basically itās what we are observing. We need to rewrite it to use a different approach for finding message files as they are always stored at the root.