I’m trying to implement OpenMRS Core 2.5.0 using war file.
I have manually imported openmrs demo data on MySQL (version 8.0.29 on ubuntu 20).
I try to install OpenMRS without creating a database or adding the demo data. So it just needs to update the database, but it fails. Here’s the issue. How I can solve it?
@roozbeh Kindly forgive me but what you have shared doesn’t look like an error.
It looks like and INFO statement that prints at startup. Kindly share the entire error log on your terminal using pastebin. Am sorry for a bother!
@roozbeh this is okay. The reason it doesn’t work is because you may be using modularized dependencies with old TomCat version. TomCat (bcel library) tries to scan class files attempting to find annotations like @WebServlet and others, but encounters unknown byte code. Kindly which Tomcat version are you running?
@roozbeh Openmrs 2.5.0 supports Tomcat 8.5+ and 9 basing on the release notes on this link. kindly am not certain the version you are running but keep posting the community for more help.
Versions of MySQL prior to 5.7 accepted all zeroes as a valid date. This was deprecated in 5.7 and, IIRC, support was basically dropped in MySQL 8 unless you just disable constraint checking altogetehr. You’re best bet might be to clean-up the MySQL dump that you manually imported to remove any DEFAULT '0000-00-00' or DEFAULT '0000-00-00 00:00:00 declarations and re-import the database.
Update connection.url in openmrs-runtime.properties, by appending &zeroDateTimeBehavior=convertToNull
so that 0000-00-00 00:00:00 dates can be converted to null.
@dkayiwa I don’t find the openmrs-runtime.properties in the server. Maybe this file is created after installing openmrs? Because in my case, I can not install it at all. I search with
sudo find / -type f -name “openmrs-runtime.properties”
Error Reading Changelog File: /var/cache/tomcat7/Catalina/localhost/openmrs-2-5-0/loader/org/openmrs/liquibase/snapshots/schema-only/liquibase-schema-only-2.4.x.xml (No such file or directory) Error while trying to update to the latest database version
I also tried installing a fresh openmrs without demo data (with only an empty database) but I get this error:
There was an error while updating the database to the latest. file: org/openmrs/liquibase/updates/liquibase-update-to-latest-2.0.x.xml. Error: liquibase.exception.MigrationFailedException: Migration failed for change set liquibase-update-to-latest.xml::1::upul: Reason: liquibase.exception.DatabaseException: Table ‘openmrs.person_attribute_type’ doesn’t exist [Failed SQL: (1146) ALTER TABLE openmrs.person_attribute_type ADD edit_privilege VARCHAR(255) NULL] Error while trying to update to the latest database version
Drop the openmrs database, delete the runtime properties file (if it was already created), and then restart tomcat. Then run the openmrs setup wizard again and share the options that you selected from the setup wizard.
I have deleted the runtime properties and openmrs database and tried it again.
My system details: Java 8 - Tomcat 7 - Mysql 8 - OpenMRS enterprise 2.5.0
For OpenMRS configurations, I select the following options:
step one: I don’t have a database
step two: I need create tables - I don’t need add demo data - I don’t have a user other than root
step three: no - no
After these configurations, openmrs creates a new database, creates a new MySQL user, and create tables and core data and the setup finishes successfully (without demo data).
So until now, OpenMRS is installed without demo data. But I need the demo data. So I try to manually add the demo data to the MySQL. I manually add large-demo-data-2-2-1. (I also have tried large-demo-data-1.11.9 but got the same error.) After adding the demo data, I restart the tomcat and go to localhost. But I get this page.
Those demo datasets do not support the platform version that you are trying to install. The latest version supported, according to the file names, is 2.2.1
Therefore, start by installing openmrs platform version 2.2.1 and load the large-demo-data-2-2-1 file. After you have run it successfully and are able to log in, upgrade openmrs to the platform version that you want, which in this case is 2.5.0 by replacing the war file you have for 2.2.1 with that of 2.5.0 and then restart tomcat. You will then have 2.5.0 with the demo data that you need. After which, you can help others by uploading the demo data file for 2.5.0 on the wiki page.
However, it is a bit unclear to understand that for using the demo data, you should have the platform version of 2.2.1 or before. It might be nice if you could add this information on the webpage of downloading demo data to reduce troubles for future installations.