Hi
It seems that the versions are compatible which is good; however, I noticed that your current DHIS2 version is 2.40.9, may I ask if you have recently performed an upgrade? It seems that the issues you are facing are probably caused by upgrading from lower version to a higher version without following the ‘upgrade notes’.
First, please make a full DB backup including your current /nmdr.war and dhis.conf files.
Second, if you still have a full database backup, I would recommend to revert back to the original version and when upgrading from version to version, follow the upgrade steps. See ‘upgrade notes’ in #releases. The upgrade notes contain important steps for the admin to perform before upgrading to a higher version.
Third, the log shows many ‘invalid character’ errors, so you might also need to update your server.xml <Connector and add the line relaxedQueryChars="[]"
Please see if you can perform a sequential upgrade and follow the upgrade notes. If you no longer have the original backup before the upgrades. We will need further expert support as this is a critical migration issue which needs to be handled carefully (without deleting tables), see DHIS2 patch release 2.36.2 is now available - [HOT FIX] - #16 by Ameen .
Thanks!