Trouble implementing OpenMRS 2.5.9 and 2.6.0 on fresh Tomcat installs

Application Name: Platform / Reference Application Version Number: For Platform: 2.6.0; Reference Application: 2.13.0 (based on 2.5.9)

Question: I am implementing OpenMRS 2.x on separate fresh, production Tomcat installs on both Ubuntu 20.04 and 22.04, both on Tomcat 9 and Java 11. (Java 8 and Tomcat 9 ran into similar problems.)

After I install Tomcat successfully (utilizing OpenJDK headless via the Ubuntu repo as its foundation) on both OS versions, and after I configured it, I am having trouble getting past deployment of the WAR file.

The error messages I get are as follows:

catalina.out java.lang.ClassCastException: class java.io.ObjectStreamClass$Caches$1 cannot be cast to class java.util.Map (java.io.ObjectStreamClass$Caches$1 and java.util.Map are in module java.base of loader ‘bootstrap’)

localhost.(date today).log SEVERE [http-nio-8080-exec-1] org.apache.catalina.core.StandardContext.listenerStart Error configuring application listener of class [net.sf.ehcache.constructs.web.ShutdownListener] java.lang.ExceptionInInitializerError … Caused by: org.openmrs.api.APIException: ‘{0}’ should be a directory but it is not

I have already changed the tomcat user’s home directory but it does not work as the tomcat application / OpenMRS does not recognize it. Also, previous workarounds involving creating the OpenMRS directory in /var/lib/ as well as /var/lib/tomcat9/ do not work as well.

Is it possible to get the full tomcat log via a paste site like pastebin.com or any other?

Good day. Here are the PasteBin logs:

Localhost Log from Fresh OpenMRS 2 Installation - Pastebin.com - localhost.2023-05-15.log

Catalina.out file from Fresh OpenMRS 2 Installation - Pastebin.com - catalina.out

Is this of any help? Configuring Apache Tomcat 9

I followed the user adding instructions in Tomcat before I deployed OpenMRS at any time I tried to deploy it. Whenever I deploy OpenMRS after restarting Tomcat, there is an error. I do not have access to the said local server currently (it is night time in Manila and after normal office hours), but I will reproduce it again for this purpose tomorrow.

Update:

I tried reproducing it on an LXD-based container; OpenMRS has installed successfully there. However, on VMs based on a different VM platform, this very issue described in the Pastebin and the original post occurs.

I do not know where is the root cause of this issue now.

As per the link that i shared above, my suspicion is that this could be a permissions issue.