Installing OpenMRS Standalone 2.12.2 on MacOS 11.6.5 (with Java 8)

Hello I am trying to installing OpenMRS Standalone 12.2.2 on my MacbookPro I do not have experience in programming

it gives an error. I have copied this file below. Can you please tell me whether this installation can be done or its not easy for a non-programmer? Thanks in advance Kumara

Initial configuration needed Deleting active database Unzipping database from demodatabase.zip Resetting connection.password to ‘test’ Attempting to load properties file in current directory: openmrs-standalone-runtime.properties Using runtime properties file: openmrs-standalone-runtime.properties Attempting to load properties file in current directory: openmrs-standalone-runtime.properties Using runtime properties file: openmrs-standalone-runtime.properties Working directory is /Applications/referenceapplication-standalone-2.12.2/. Opening MySQL connection to create openmrs/test users

[/Applications/referenceapplication-standalone-2.12.2/database/bin/mysqld][–no-defaults][–basedir=/Applications/referenceapplication-standalone-2.12.2/database][–max_allowed_packet=96M][–port=3316][–datadir=/Applications/referenceapplication-standalone-2.12.2/database/data][–character-set-server=utf8][–socket=mysql.sock][–collation-server=utf8_general_ci][–pid-file=/Applications/referenceapplication-standalone-2.12.2/database/data/MysqldResource.pid]

[MysqldResource] launching mysqld (driver_launched_mysqld_1) Exception in thread “driver_launched_mysqld_1” com.mysql.management.util.WrappedException: java.io.IOException: Cannot run program “/Applications/referenceapplication-standalone-2.12.2/database/bin/mysqld”: error=86, Bad CPU type in executable at com.mysql.management.util.Exceptions.toRuntime(Exceptions.java:55) at com.mysql.management.util.Exceptions$Block.exec(Exceptions.java:89) at com.mysql.management.util.RuntimeI$Default.exec(RuntimeI.java:180) at com.mysql.management.util.Shell$Default.run(Shell.java:140) at java.lang.Thread.run(Thread.java:750) Caused by: java.io.IOException: Cannot run program “/Applications/referenceapplication-standalone-2.12.2/database/bin/mysqld”: error=86, Bad CPU type in executable at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) at java.lang.Runtime.exec(Runtime.java:621) at com.mysql.management.util.RuntimeI$Default$1.inner(RuntimeI.java:177) at com.mysql.management.util.Exceptions$Block.exec(Exceptions.java:86) … 3 more Caused by: java.io.IOException: error=86, Bad CPU type in executable at java.lang.UNIXProcess.forkAndExec(Native Method) at java.lang.UNIXProcess.(UNIXProcess.java:247) at java.lang.ProcessImpl.start(ProcessImpl.java:134) at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) … 6 more

@kmendis oh sorry! Kindly always use pastebin to share entire error logs.

Hi - I’m getting the same error messages, and can’t find an answer to this issue on the site. I’m on MacOS Ventura 13.4.1. I’ve installed Java v8 update 3.8.1. I am a technopeasant and have no programming knowledge whatsoever.

I followed the link to Paste Bin but couldn’t figure out how to use it to share on this site. (I think I’ve maxed out on doing stuff I do not remotely understand for today!)

Any help would be much appreciated

1 Like

I hear you, I was hoping we could use this in Papua New Guinea, but I can’t even run/ open the set-up.

@katesherry Oh sorry! was your error fixed? @annmclarke kindly which error are you facing?

Thank you for your email. No. I have up. I support my team mostly remotely, so if I can’t work out setup remotely, then OpenMRS is too hard to set up for the team. It looked great

sorry too hard for this volunteer Ann

Dr Ann M Clarke Businesses for Health Papua New Guinea

TB and HIV toll free info line 7676 2482

Kindly which error are you facing? Besides are you following any guide to install the instance? if yes kindly share the link to the guide.

In use a MACbookpro the “ jar” file would not open downloaded java wouldn’t run repeated several times asked a friend no luck gave up

Dr Ann M Clarke Businesses for Health Papua New Guinea

TB and HIV toll free info line 7676 2482

Kindly I don’t seem to understand what you are communicating. Is the issue related to the java installation?

Unfortunately, the OpenMRS Standalone doesn’t work on newer Macbook Pro’s; while it works on Intel-based MacBooks, it does not work on Apple Silicon (so any MacBook Pro released after 2021 or 2020 for the 13in model). The technology we relied on to make the standalone work has not been updated in some time and there’s currently no replacement for it.

However, you should be able to follow the instructions on the wiki under “Installing OpenMRS” or “Installing OpenMRS on Docker” to get OpenMRS running locally.

Hi Anne -

Sorry for slow reply! Wondering if you had the same problem as I did? I found eventually that the problem was the version of Java I’d installed - my Mac has an M1 chip, not Intel, so I needed the ARM64 version, not the 64-bit Intel one.

Once I’d sorted that out, I could install and open the standalone version. Now to learn how to use it…

Good luck!

Kate

Hi Juliet,

Sorry for slow reply, have been away for a bit. THanks for following up, I found the problem! I’d downloaded Java for macOS Intel, not ARM64 for M1 chip.

Thanks!

Kate

How are you able to run the openmrs standalone version on ARM64 for the M1 chip? Are you using something like Rosetta 2?

No, it seems to be working fine so far… but I haven’t gone far in trying to configure things

And all you did, to make it work, was download Java for the ARM64 M1 chip?

Yes, as far as I recall!

1 Like

Hi @dkayiwa, @ibacher, @jwnasambu -

I’ve just come back to this work after a break, and the reference application doesn’t seem to be working anymore - no idea what changed.

Here’s the Java log when I try just to open the .jar file: Attempting OpenMRS Standalone install - Pastebin.com

And here’s the log in Terminal app when I open using the command line: Attempting standalone install from Terminal app - Pastebin.com

I realise this may just be the Apple silicon issue (using a MacBook Air with M1 chip), but just weird that I could open it before.

Any help/advice appreciated!!

Kate

It seems like there are several issues in the provided error message. Kindly let us break it down and address each problem:

  1. Missing Resource Exception: Caused by: java.util.MissingResourceException: Resource '5-5-9/Mac_OS_X-aarch64/mysqld' not found

This error indicates that a required resource, specifically the MySQL executable (mysqld ), is not found. To fix this make sure that the MySQL executable is available in the specified location. It seems like it’s looking for the executable under '5-5-9/Mac_OS_X-aarch64/mysqld' . Ensure that the MySQL installation is complete and that the executable is in the expected path.

  1. MySQL Connection Exception: Exception in thread "main" com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
    This error suggests that the application is unable to establish a connection to the MySQL database server. Possible reasons include incorrect database server credentials, database server not running, or network issues.
  • Ensure that the MySQL server is running.
  • Verify that the database connection properties (such as username, password, and database name) in the openmrs-standalone-runtime.properties file are correct.
  • Check if there are any firewall or network issues preventing the application from connecting to the MySQL server.

Other Information:

Unzipping database from demodatabase.zip
Resetting connection.password to 'test'

These lines indicate that the application is unzipping a database from a ZIP file (demodatabase.zip ) and resetting the MySQL connection password to ‘test’. Ensure that the database ZIP file exists and is not corrupted. Also, confirm that the specified password is correct and matches the MySQL server configuration.

In short, address the missing resource issue by ensuring the MySQL executable is in the expected location. Then, troubleshoot the MySQL connection issue by verifying server availability, credentials, and network connectivity and you will be good to go.

Hi Juliet,

Thanks very much for this. It’s over my head, but I’m trying…

  1. Missing resource exception: Is that file path specified by the reference application? Can you tell me how to find where MySQL executable is sitting on my computer? I googled it, couldn’t find anything; have also searched the hard drive for “mysqld” - nothing - although MySQL is installed

  2. MySQL Connection Exception: The MySQL server is definitely running. I couldn’t find an app to open the .properties file

I thought the standalone app was usable by those of us with no tech background, but apparently not!! If this all sounds like my knowledge gap is too large, let me know. I will see if I can find an extremely patient person to help me with the set up.

Thanks

To find the MySQL Executable on your computer try the following steps basing on your OS:

On Windows OS:

  1. Check the MySQL Installation Directory:
  • By default, MySQL is often installed in C:\Program Files\MySQL\MySQL Server\ or C:\Program Files (x86)\MySQL\MySQL Server\.
  1. Check System Path:
  • MySQL executable might be added to the system path. Open a command prompt and type mysql or mysqld and press Enter. If MySQL is in the path, the command should execute.
  1. Check Services:
  • Open the Services application (services.msc) and look for the MySQL service. The executable path should be mentioned there.

On Linux machine:

MySQL is often installed in /usr/bin or /usr/sbin . You can use the which command to find the location of the executable. This is the command: which mysql

Also you can use this command service mysql status to check the MySQL service status and find the executable path:

Am sorry your MySQL server is running but you are having trouble connecting, kindly do mind making sure that you have the correct connection properties in your application. Check the following:

  • Hostname and Port: Ensure that you are connecting to the correct hostname and port where MySQL is running.
  • Username and Password: Double-check the username and password used for the MySQL connection.

Lastly, you can open a .properties file and to find a specific application, you can use a text editor to open it. .properties files are often plain text files and can be edited with any text editor like Notepad (Windows), TextEdit (Mac), or editors like VSCode, Sublime Text, etc.

If you are on the command line, you can use commands like cat or vi (on Linux) or type (on Windows) to view or edit the file i.e

cat filename.properties  # Linux
type filename.properties # Windows

kindly make sure to replace filename.properties with the actual name of your .properties file.