Middleware/Sync Module setup
Prerequisites
Java 8 - Click to download
Apache Tomcat 8 - Click to download
Deployment
Deployment of the middleware code to tomcat is by using a war file. This is a file similar to a zip file.
On dropping the war file in the webapps folder of tomcat server, the app gets automatically deployed. Once it is deployed, the following needs to be ensured.
In the EMR-Middleware\WEB-INF\classes directory, go to the config.properties file. Ensure that you have the right values in the MybatisEnvironmentId property and serverhost property. This has the the db environment id that is being used by mybatis which is present in the db_properties.xml file in the same folder and the server details which OpenMRS is hosted on. As the middleware will work optimally if it is on the same server as the openmrs , it should be by default localhost.
Go to the db_properties.xml file, check the details of your environment id being used and ensure that the username and password match with that of the openmrs database.
On making changes, restart tomcat.
Alternately , you can create the war file with necessary credentials and deploy into tomcat using it’s admin UI as given below,
Install Tomcat
To install Tomcat
…Run the installer you downloaded.
Select port and add username and password on the configuration screen.
2. Deploy war file.
Open 127.0.0.1 or localhost:8080(the port you selected while installing tomcat)
On the next page, you will see an option to deploy the app.
Choose the path of the war file and deploy on Tomcat.
3. Open http://localhost:8080/EMR-Middleware/
If you see “Hello World” then you have successfully install sync module on your system.