Issues with installing OpenMRS Core 2.4.0 (Tomcat on Linux)

Application Name: OpenMRS Platform/ core Version Number: 2.4.0-SNAPSHOT

Question: I have been trying to install OpenMRS core on Tomcat running on Linux, the version details are as below:

OpenMRS Platform/ core: 2.4.0-SNAPSHOT

Ubuntu (Linux): 18.04.2 LTS

Java (openjdk): 1.8.0_275

Apache Tomcat: 9.0.26

MySQL: 14.14 Distrib 5.7.32

The OpenMRS core source was downloaded from GitHub and built locally to generate the Web archive file which was then deployed to Tomcat. The same installation works perfectly fine when run using the Jetty server. It’s difficult to understand why the error gets generated with the Tomcat server. After installing on the local Tomcat and hitting “http://localhost:8080/openmrs/” the initial setup page pops up and everything goes on fine till the final page of the set up process:

By this time the server is able to connect to MySQL and create all the necessary tables. Finally the below error gets displayed on the browser:

The Tomcat log file has the below entries:

Posting this question as the Wiki pages/ development guides and earlier discussions on this forum did not have much information regarding deployment on Tomcat (the Jetty server option works well!). Please advise as to what can be the right way forward.

Thank you.

From the logs, this is the underlying cause: org.hibernate.search.exception.SearchException: Unable to create index directory: /opt/openmrs/lucene/indexes for index org.openmrs.ConceptNumeric

The application does not seem to have permission to create that folder. Can you create the folder or assign permissions to the tomcat account?

@dkayiwa The suggestion offered solved the problem. The platform is up and running:

But surprisingly after the platform has been successfully started, even if the folder ( /opt/openmrs) permission granted to Tomcat is revoked, the platform continues to run upon restarting the Tomcat server.

Thanks a lot for the solution!