openmrs-runtime.properties error at initial setup

Platform 2.3.2

I am new to OpenMRS and web development in general, I work on a Win10 machine and use XAMPPs Apache, MySQL and Tomcat Services and all of them are running fine. I deployed the war file in the tomcat webapps folder. But I still get an error when trying the initial setup it shows the following error message:

<<

The following error occurred at startup: Error occurred while trying to get the updates needed for the database. Unable to get a connection to the database. Please check your openmrs runtime properties file and make sure you have the correct connection.username and connection.password set java.lang.RuntimeException: Error occurred while trying to get the updates needed for the database. Unable to get a connection to the database. Please check your openmrs runtime properties file and make sure you have the correct connection.username and connection.password set at org.openmrs.util.DatabaseUpdater.getUnrunDatabaseChanges(DatabaseUpdater.java:630) at org.openmrs.util.DatabaseUpdater.getUnrunDatabaseChanges(DatabaseUpdater.java:587) at org.openmrs.util.DatabaseUpdater.updatesRequired(DatabaseUpdater.java:252) at org.openmrs.web.Listener.setupNeeded(Listener.java:217) at org.openmrs.web.Listener.contextInitialized(Listener.java:179) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5136) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5662) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1007) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:983) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:639) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1127) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:2020) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.Exception: Unable to get a connection to the database. Please check your openmrs runtime properties file and make sure you have the correct connection.username and connection.password set at org.openmrs.util.DatabaseUpdater.getLiquibase(DatabaseUpdater.java:361) at org.openmrs.util.DatabaseUpdater.getUnrunDatabaseChanges(DatabaseUpdater.java:615) … 17 more Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) at com.mysql.jdbc.Util.getInstance(Util.java:408) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:898) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:887) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:861) at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2094) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2019) at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:776) at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:386) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at org.openmrs.util.DatabaseUpdater.getConnection(DatabaseUpdater.java:423) at org.openmrs.util.DatabaseUpdater.getLiquibase(DatabaseUpdater.java:358) … 18 more Caused by: java.sql.SQLException: Access denied for user ‘openmrs_user’@‘localhost’ (using password: YES) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:965) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:873) at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1710) at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1226) at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2188) at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2035) … 32 more

See the server log for full output.

I already checked for the openmrs-runtime.properties file but could not find it in the stated ApplicationData directory, but could not find it. I am struggling with this problem for a few days now and I really would appreciate some help! thanks

The standalone version is running with no problems, but if I try to start OpenMRS via the Plattform war file through Tomcat I always get the error I posted above. So I guess my configuration of the MySQL or the Tomcat server is somehow faulty. I also tried installing from scratch or deploying Tomcat (7) and MySQL (5.7) on their own without XAMPP but the outcome is the same. If some one could provide help I would be very grateful.

Is this helpful for locating your runtime properties file?

Hallo Daniel! Thank you for replying! I could not locate the runtime properties file. From what I have found on the internet I think that Tomcat has no permissions to read/write to create the file in the first place. Unfortunately I do not know how to do this, if this is is the case could you provide some kind of help? I would really appreciate it if you could confirm my suspicion or tell me what else could cause this error. Thanks again!

Kindly follow the path below to access the runtime properties file on your machine.

On Windows systems:

C:\Documents and Settings\YOURUSERNAME\Application Data\OpenMRS
C:\Windows\system32\config\systemprofile\Application Data\OpenMRS

On Mac OS X or Linux systems:

~/YOURUSERNAME/.OpenMRS
/usr/share/tomcatX/.OpenMRS

Share the full tomcat log via pastebin.com

I just recreated the error, this is the catalina log: Tomcat log - Pastebin.com Thank you for taking a look

Hello Juliet! Thanks for replying! I checked again after I just recreated the error, there are no properties files in these paths, not even a folder called openmrs was created. Do you have any explanation for this problem?

Which OS are you using?

The log you have shared does not have any errors. Do you have catalina.out?

I don’t think so, it is not located in the logs folder. I also let the search function run on my C drive there is no log, named catalina.out Is the one you are looking for one of these? That are all logs located in the xampp/tomcat/logs directory

image

I am working with Windows 10 Pro.

Open those files and share one which has a stack trace similar to what you reported above.

That would be this one: tomcat7-stdout.2021-04-18 - Pastebin.com

MySQLSyntaxErrorException: Unknown database 'openmrs'

Which means that in the setup wizard, you chose the option of using an existing openmrs database, which of course would fail because it does not exist. Share screenshots of the setup wizard and we shall guide you where you need to change or choose another option.

That is the problem, I cannot even start the installation wizard, because I instantly get the error message as you see in the screenshot below: Tomcat is running fine on its own:

Directly after I click on the openmrs application:

Share the full server side log via pastebin.com

Do you mean the mysql log by server side log? If so here it is: mysql_error - Pastebin.com If not I do apologize, I do not know my way around those things well.

The one that has the stack trace.

I’m sorry for the inconvenience.