GSOC 2023: Improving the OpenMRS Developer Experience: Updating the SDK - Updates and Discussion


I’ll be working on the project Improving the OpenMRS Developer Experience: Updating the SDK. This aims to improve the OpenMRS SDK to support the evolving needs of OpenMRS development.

I’ll use this thread to give updates and discuss the project.


Primary mentor: @dkayiwa

Backup mentor: @jnsereko


I am incredibly excited about the remarkable results we hope to achieve in this project.


I am getting the following integration test failures when running mvn clean install on the SDK.

[ERROR] BuildDistroIntegrationTest.testBuildDistroFromDistroFile:21->AbstractSdkIntegrationTest.assertFilePresent:222->AbstractSdkIntegrationTest.assertPathPresent:244 Expected /home/wikum/Documents/openmrs-sdk/integration-tests/target/test-classes/integration-test/target/web/frontend/index.html to be an existing file or directory Expected: an existing file or directory but: does not exist

[ERROR] SetupIntegrationTest.setup_shouldInstallServerFromDistroPropertiesDir:165->AbstractSdkIntegrationTest.assertPathPresent:244 Expected /home/wikum/Documents/openmrs-sdk/integration-tests/target/test-classes/integration-test/49914bf5-71d7-4755-a2e7-f597502f39d5/frontend/index.html to be an existing file or directory Expected: an existing file or directory but: does not exist

Could you give me some guidance on how to fix this issue?

cc: @dkayiwa @jnsereko

1 Like

Are you using jdk 1.8 or above? I think you should strictly use 1.7

Those tests may require a version of Node (16) to be installed on your computer and the default on the $PATH. (They run a somewhat outdated version of the CLI and there were some breaking changes between Node 16 and Node 18 to do with peer dependency resolution and the MD4 hash).

I tried with jdk1.7.0_80 but still getting the same test failures.

Then i think try out @ibacher’s suggestion I also faced the same issue as i was trying out these project but i remember switching java versions cc @dkayiwa

1 Like

I tried to deploy O3 with different methods for the last few days.

  1. I set up the OpenMRS server using maven openmrs-sdk: setup
  2. Then I deployed the necessary modules using a file. · GitHub
  3. I ran the server and tried to access http://localhost:8080/openmrs/spa/login. But I am getting a 404 error. When I tried to deploy O3 with Tomcat I got stuck in the same place. Am I missing some steps? Any leads are highly appreciated.

Which instructions are you following for this setup? And which exact command did you use to deploy? Give as much details as you can.

Also, if you have the output of the commands you ran, that’s likely to have something very useful. It may also be necessary to run more up-to-date versions of things. Core 3.3.1 is from 2020 and a lot has changed since then.

With the guide of openmrs3-helpme. I tried to deploy O3 using Tomcat by following these instructions.,Configure&Deploy-Part1:BuildandDeploytheOpenMRS3Frontend Here are the details of what I tried and the outputs I got.

Java version: openjdk version “1.8.0_362”

Tomcat version: 9.0.74

node version: v16.13.0

npm version: 6.14.15

  1. Installed Tomcat on /opt/tomcat.

  2. Installed OpenMrs platform 2.5 on Tomcat

  3. build file with mvn openmrs-sdk:build-distro : Output -

  4. Build and assemble openmrs frontend using npx openmrs@next build --api-url /openmrs && npx openmrs@next assemble --mode config --config importmap.json: Output -

  5. copy the generated modules folder and dist folder into /var/lib/OpenMRS

 cp -r * /var/lib/OpenMRS/frontend/
 cp -r modules/ /var/lib/OpenMRS/
  1. Restart the Tomcat service

  2. When I go to the link http://localhost:8080/openmrs/spa I am getting the following error.

No file with path ‘/var/lib/OpenMRS/frontend/import-map.json’ exists

  1. I have importmap.json on the given location. So I renamed the file as import-map.json. Now I am getting these two errors on browser console.

Uncaught (in promise) Error: Unable to resolve specifier '@openmrs/esm-root-config' from http://localhost:8080/openmrs/spa/

Uncaught (in promise) Error: Unable to resolve specifier ‘@openmrs/esm-styleguide’ from http://localhost:8080/openmrs/spa/

openmrs.log: WARN - OpenmrsUtil.getApplicationDataDirectory(1085) |2023-05-16T16:21:23,666| U -

So a couple of things:

  1. You seem to be using an old version of module-spa that supplied it’s own SPA page. Update to the latest version.
  2. Update to a newer version of the esm libraries.

I forgot to share my new file.

I found the latest version for module-spa here: Releases · openmrs/openmrs-module-spa · GitHub. Is there a newer version of module-spa? Where can I find it?

Could you give me more information on updating the esm libraries?

Yes. You can see it in the tags. As a general rule, we don’t use GitHub Releases to track releases of modules.

From your


@openmrs/esm-login-app should be the same version as core, but, you probably want the latest versions. The latest versions running on dev3 can be found in this link. Alternatively, the last released versions (what runs on test3) can be found in this link.

I updated and built the file. After that when I tried localhost:8080/openmrs/spa/login I got the following error message.

No mapping for GET /openmrs/importmap.json

So I pasted a copy of importmap.json to /opt/tomcat/webapps/openmrs. After that /spa/login works fine but when it continues to the home page I am getting the following errors.

I installed the spa.frontendModules.@openmrs/esm-framework=4.4.1. Now I am getting this error.

Should I manually set value to spa.publicUrl in file? What is the value for it should be?

@dkigen can you kindly help out here

You should try to make your environment as close to dev3 as possible. Try to add most modules


I have also seen replacing the version with next, ie *@openmrs/esm-outpatient-app=4.4.1-pre.1557 with *@openmrs/esm-outpatient-app=next but i don’t have alot of information about it

I added modules according to dev3 . Here is my new file. : gist:175987ce6fb8cdffeeed8218c33d6213 · GitHub.

After logging in, I get an empty location list with the following console error.

Does your file have all the modules mentioned here? openmrs-distro-referenceapplication/pom.xml at main · openmrs/openmrs-distro-referenceapplication · GitHub

I was missing a few modules. I added them but I am still getting the empty location list with the console error