OpenMRS-Core Build Failure on openmrs-api in eclipse

i am currently trying to install openmrs-core in eclipse using github repository. But when i run command mvn clean install it show error and and failure in openmrs-core api. The error is like this ] e[1;31mFailures: e[m [ERROR] e[1;31m StorageServiceTest.existsShouldReturnTrueWhenFileExists:478->saveTestData:118->saveTestData:132->lambda$existsShouldReturnTrueWhenFileExists$33:480 Expected: is but: was e[m [ERROR] e[1;31m StorageServiceTest.getDataShouldFailIfKeyTriesToAccessFilesOutsideStorageDir:586 Unexpected exception type thrown, expected: <java.lang.IllegalArgumentException> but was: <java.nio.file.NoSuchFileException>e[m [ERROR] e[1;31m StorageServiceTest.purgeDataShouldReturnTrueWhenDeleted:442->saveTestData:118->saveTestData:132->lambda$purgeDataShouldReturnTrueWhenDeleted$31:446 Expected: is but: was e[m [ERROR] e[1;31m StorageServiceTest.saveDataShouldNotAllowToWriteFilesOutsideStorageDir:563 Expected: is but: was e[m [ERROR] e[1;31m DaemonTest.runInNewDaemonThread_shouldNotThrowErrorIfCalledFromADaemonThread:163 Expected: is but: was e[m [ERROR] e[1;31m ImageHandlerTest.saveObs_shouldRetrieveCorrectMimetype:98 expected: but was: <image/png>e[m [ERROR] e[1;31mErrors: e[m [ERROR] e[1;31m ObsServiceTest.saveObs_shouldCreateNewFileFromComplexDataForNewObs:641 » IllegalArgument Complex data must not be nulle[m [ERROR] e[1;31m ObsServiceTest.saveObs_shouldDeleteThePreviousFileWhenAComplexObservationIsUpdatedWithANewComplexValue:1809 » IllegalArgument Complex data must not be nulle[m [ERROR] e[1;31m ObsServiceTest.saveObs_shouldNotOverwriteFileWhenUpdatingAComplexObs:684 » IllegalArgument Complex data must not be nulle[m [ERROR] e[1;31m StorageServiceTest.purgeDataShouldScheduleDeletionIfFileOpen:457->saveTestData:118->saveTestData:132->lambda$purgeDataShouldScheduleDeletionIfFileOpen$32:463 UncheckedIO java.nio.file.NoSuchFileException: C:\Users\lenovo\AppData\Local\Temp\junit-15807606636507832586\2025%5C03-20%5C2025-03-20-11-39-25-826-2bl7RIFfe[m [ERROR] e[1;31m StorageServiceTest.saveDataShouldPersistDataIfModuleIdDiffersButKeySuffixSame:212->saveTestData:118->saveTestData:132->lambda$saveDataShouldPersistDataIfModuleIdDiffersButKeySuffixSame$9:214->saveTestData:132->lambda$saveDataShouldPersistDataIfModuleIdDiffersButKeySuffixSame$8:222 UncheckedIO java.nio.file.NoSuchFileException: C:\Users\lenovo\AppData\Local\Temp\junit-14302918248255279153\test_module%5C3e6cb31de[m [ERROR] e[1;31m StorageServiceTest.saveDataShouldPersistDataIfNoModuleIdAndKeySuffix:161->saveTestData:118->saveTestData:132->lambda$saveDataShouldPersistDataIfNoModuleIdAndKeySuffix$2:167 UncheckedIO java.nio.file.NoSuchFileException: C:\Users\lenovo\AppData\Local\Temp\junit-13992765985881010283\2025%5C03-20%5C2025-03-20-11-39-25-355-pf5OMfYWe[m [ERROR] e[1;31m StorageServiceTest.saveDataShouldPersistDataWithModuleId:174->saveTestData:118->saveTestData:132->lambda$saveDataShouldPersistDataWithModuleId$3:181 UncheckedIO java.nio.file.NoSuchFileException: C:\Users\lenovo\AppData\Local\Temp\junit-11771250311178482392\test_module%5C2025%5C03-20%5C2025-03-20-11-39-25-403-hHFbBV8Ce[m [ERROR] e[1;31m StorageServiceTest.saveDataShouldPersistDataWithModuleIdAndKeySuffix:188->saveTestData:118->saveTestData:132->lambda$saveDataShouldPersistDataWithModuleIdAndKeySuffix$4:196 UncheckedIO java.nio.file.NoSuchFileException: C:\Users\lenovo\AppData\Local\Temp\junit-9809692573190789100\test_module%5Ctest_keye[m [ERROR] e[1;31m AbstractHandlerTest.saveObs_shouldNeverOverwritePreviousFiles:67 » UncheckedIO java.nio.file.NoSuchFileException: C:\Users\lenovo\AppData\Local\Temp\appdir-for-unit-tests-10510787253601900565\storage\obs%5Cobs%5C2025%5C03-20%5C2025-03-20-11-42-08-088-gYTctsgse[m [ERROR] e[1;31m BinaryDataHandlerTest.saveObs_shouldRetrieveCorrectMimetype:90 » IllegalArgument Complex data must not be nulle[m [ERROR] e[1;31m BinaryStreamHandlerTest.saveObs_shouldRetrieveCorrectMimetype:92 » IllegalArgument Complex data must not be nulle[m [ERROR] e[1;31m MediaHandlerTest.saveObs_shouldRetrieveCorrectMimetype:98 NullPointer Cannot invoke “org.openmrs.obs.ComplexData.getData()” because the return value of “org.openmrs.Obs.getComplexData()” is nulle[m [ERROR] e[1;31m TextHandlerTest.saveObs_shouldRetrieveCorrectMimetype:83 » IllegalArgument Complex data must not be nulle[m

what should i do ?

For long stack traces like this, we recommend using a paste site like pastebin.com and then share the paste url in your post. Do you mind editing your post and replace the long stack trace with a paste url? And for the stack trace, include the full log starting from the command you are running.

Thank you for the recommendation. i have pasted in this link [INFO] Results:[INFO][ERROR] Failures:[ERROR] StorageServiceTest.existsS - Pastebin.com i am new in this sector and trying to build openmrs-core and wish to modify it as per need. previously i trying installing using openmrs sdk but the code was compressed in it so i tried installing through and even by cmd but in both i got these errors. please help me to solve these errors i would be very grateful

What is the output of this command? mvn -v

C:\Users\lenovo>mvn -v Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937) Maven home: C:\Program Files\apache-maven-3.9.9 Java version: 1.8.0_441, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk-1.8\jre Default locale: en_US, platform encoding: Cp1252 OS name: “windows 11”, version: “10.0”, arch: “amd64”, family: “windows”

if you have any documentation through which openmrs-core can be installed successfully . i am willing to start from the beginning and will be very grateful. Thank you.

I have just committed a fix to this. Can you pull again and compile?

1 Like

Thank you very much. mvn clean install run successfully but after that when i entered command mvn jetty:run which failed then i tried runnning the file using openmrs-sdk:run and it ran successfully now i am trying to check whether the change in code appears successfully . Once again thank you for your effort. Can we connect through any medium ?

For mvn jetty:run, did you run it from the webapp folder? If yes, can you share the detailed error log?

i again tried it and this time jetty server is successfully running.

Can you also provide me guidance for setting up modules in it?

You can just run the sdk and select any distribution that has modules.

i had tried doing it from sdk but the files were compressed in omod file but i had to do some changes in the code content. what sould i do ?

i have installed legacy-ui from github and paste the omod file which run successfully but the result was not what i want it was missing something can you suggest me other modules for openmrs ?i am searching for working github repositories of modules

i added the needed modules from github successfully but when i tried adding admin ui module , it told me to install emr module which was added succesffully but didn’t run, metadatamapping was needed for it to run then i tried builiding omod file of metadatamapping but the build was failure on api what should i do ? i also tried mvn clean -DskipTests , then it show failure on OWA