Repeated errors while installing openMRS


I’ve been trying to install OpenMRS on my computer (Ubuntu 20.04 installed alongside Windows 10) for an internship with Ace Medlock, but I’ve been running into the following errors when running mvn clean install (I have the latest version of the master branch): [INFO] Results: [INFO] [ERROR] Failures: [ERROR] UserServiceTest.getAllUsers_shouldNotContainsAnyDuplicateUsers:680 expected: <11> but was: <12> [ERROR] ModuleFactoryTest.loadModules_shouldNotStartTheLoadedModules:171 expected: <3> but was: <0> [ERROR] ModuleFactoryTest.loadModules_shouldSetupRequirementMappingsForEveryModule:153 expected: <3> but was: <0> [ERROR] Errors: [ERROR] ModuleExtensionsTest.getExtensions_shouldNotFailExpandingAnExtensionNameCausingANoClassDefinitionFoundError:96 » Module [ERROR] ModuleFactoryTest.loadModule_shouldAlwaysLoadModuleIfReplacementIsWanted:82->loadModule:185 » Module [ERROR] ModuleFactoryTest.loadModule_shouldLoadANewerVersionOfTheSameModule:95->loadModule:185 » Module [ERROR] ModuleFactoryTest.loadModule_shouldLoadModuleIfItIsCurrentlyNotLoaded:59->loadModule:185 » Module [ERROR] ModuleFactoryTest.loadModule_shouldNotLoadAnOlderVersionOfTheSameModule:107->loadModule:185 » Module [ERROR] ModuleFactoryTest.startModule_shouldStartAllDependencies:121->loadModule:185 » Module [ERROR] ModuleFileParserTest.moduleFileParser_shouldFailCreatingParserFromFileIfInputStreamClosed:88 » FileNotFound [ERROR] ModuleFileParserTest.parse_shouldParseValidLogicModuleFromFile:143 » Module Un… [ERROR] ModuleFileParserTest.parse_shouldParseValidXmlConfigCreatedFromInputStream:99 » FileNotFound [ERROR] ModuleUtilTest.expandJar_shouldExpandDirectoryWithParentTreeIfNameIsDirectoryAndKeepFullPathIsTrue:626 » NoSuchFile [ERROR] ModuleUtilTest.expandJar_shouldExpandDirectoryWithoutParentTreeIfNameIsDirectoryAndKeepFullPathIsFalse:647 » NoSuchFile [ERROR] ModuleUtilTest.expandJar_shouldExpandEntireJarIfNameIsEmptyString:665 » NoSuchFile [ERROR] ModuleUtilTest.expandJar_shouldExpandEntireJarIfNameIsNull:681 » NoSuchFile /h… [ERROR] ModuleUtilTest.expandJar_shouldExpandFileWithParentTreeIfNameIsFileAndKeepFullPathIsTrue:697 » NoSuchFile [ERROR] ModuleUtilTest.getPackagesFromFile_shouldSkipOptionalFoldersIfJarFile:741 » FileNotFound [INFO] [ERROR] Tests run: 4350, Failures: 3, Errors: 15, Skipped: 36 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary for OpenMRS 2.5.0-SNAPSHOT: [INFO] [INFO] OpenMRS … SUCCESS [ 1.912 s] [INFO] openmrs-tools … SUCCESS [ 0.543 s] [INFO] openmrs-test … SUCCESS [ 0.164 s] [INFO] openmrs-api … FAILURE [06:34 min] [INFO] openmrs-web … SKIPPED [INFO] openmrs-webapp … SKIPPED [INFO] openmrs-liquibase … SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 06:37 min [INFO] Finished at: 2021-02-21T12:39:03+01:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project openmrs-api: There are test failures.

I’ve tried to go back to previous versions using git checkout hash (as far as the end of Nov 2020), but I keep getting these errors. I set up my environment following the steps of the ‘Step by Step Installation for Developers’ .

I’d really appreciate your help with fixing these errors. With kind regards, Renske van Brummelen

Oh sorry! You seem to be building the OpenMRS core not installing the SDK. The error you are getting is as a result of having test failures or corrupted libraries that am thinking were not successfully downloaded of which I would suggest you delete the .m2/repository and re-run the mvn clean install command. Otherwise to build an SDK instance follow this guide OpenMRS SDK - Documentation - OpenMRS Wiki.

Can you share the full path to where you have cloned openmrs-core?

~/Documents/Internship KIK/openmrs-core

Hi, thanks for your response. This works for me until the part where it tries to connect to the database. I get the following error: Failed to setup server: Failed to execute goal org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:3.13.6:setup (default-cli) on project standalone.pom: Failed to connect to the specified database jdbc:mysql://localhost:3306/server1?autoReconnect=true&sessionVariables=default_storage_engine%3DInnoDB&useUnicode=true&characterEncoding=UTF8 Do you know what causes this?

Kindly ensure your MySQL instance is running.

(To check to see if MySQL is running , provided its installed as a service you can go to Start → Control Panel → Administrative Tools → Services (i may be a bit off on those paths, I’m an OS X / Linux user), and look for MySQL on that list. See if it is started or stopped).

service --status-all reports that mysql is indeed running. I’ve tried to rerun the same setup command (mvn openmrs-sdk:setup) and it gives the same error every time

Did you run this command mvn org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:setup-sdk prior?

yes, I have

Have you just run it or you ?

I’ve followed the steps from the link you sent. The command you just mentioned runs and I’ve reran it a couple times to make sure that it’s not due to corrupt files

I desire to see what you have. Kindly join me on this link UberConference

Hi Juliet, I installed mysql 5.6 and somehow somewhere something went wrong and I cannot get mysql to actually run. So gonna try to figure out that one somewhere in the next week first, will send you a message if I keep getting the same errors after I fixed the mysql issue. Thanks for your help so far!

Feel free to reach out.