Troubleshooting Tomcat

The following content was extracted from the Support Manual compiled by SunGard Technology Services in December 2010:

How to start the tomcat server of MIFOS application?

  • In order to start the MIFOS tomcat application, go to the path where tomcat folder is saved. Then navigate to below location

C:\apache-tomcat-6.0.18\bin\startup.bat

Start the startup.bat file and your tomcat will be started.

Here C:\ - root directory, where your tomcat folder is there.

  • In order to avoid navigating to the above location daily, user can create the shortcut of the above “start.bat” file on the desktop. Next time onwards, user just needs to double click the shortcut created on desktop. The tomcat will be started automatically.

Below is the screenshot to create shortcut.

Note: On Linux/ Ubuntu machines, you can use the following file for starting the tomcat

C:\apache-tomcat-6.0.18\bin\startup.sh

Creation of tomcat startup shortcut

After clicking the startup.bat, the following screen will appear.



When the above server start up message comes, the tomcat is started.

  • In order to stop the tomcat, at the same location the user is required to click the “shutdown.bat” or “shutdown.sh” file.

How to solve “Not Found Error” (Whenever running Mifos or Application not starting properly)?

      Following steps needs to be replicated –

  • Shut down tomcat. Delete the war file from the following location

 “C:\apache-tomcat-6.0.18\webapps\ “

Delete the work folder also.

“C:\apache-tomcat-6.0.18\work”

  • Drop the database.

Mysql> drop database <database_name>;

  • Create and load an empty database of Mifos.

Mysql> create database <database_name>;

Mysql> use <database_name>

Mysql>source <complete path of the file which you want to execute to create mifos schema together with file name>

Usually the file that creates the schema of MIFOS are (you will find these in source folder)

create_mifos_db.sql

init_mifos_password.sql

latest-data.sql

latest-schema.sql

  • Copy the war file from the correct location in

“C:\apache-tomcat-6.0.18\webapps\ “

  • Restart tomcat.

Note:

Database steps are executed only when there is no customized data in Mifos initially. If yes, do not perform the steps. Just execute the rest ones.

Always remember that in your root directory, enough disk space should be there to deploy the Mifos WAR file completely. If space is less than what expected, the tomcat will start throwing error on application unexpectedly.  So, always have around 10 GB of space should be there in your root directory.

How to re-deploy Mifos application?

To re-deploy the MIFOS with latest WAR or due to some issues with current WAR, the following   steps need to be followed

  • Shut down tomcat. Delete the war file from the following location

 “C:\apache-tomcat-6.0.18\webapps\ “

Delete the work folder also

“C:\apache-tomcat-6.0.18\work”

  • Copy the new WAR file at

“C:\apache-tomcat-6.0.18\webapps\ “

  • Restart tomcat.

How to upgrade Mifos from older to newer version?

The Mifos teams adds more functionalities to the application with each new release and version of Mifos. In order to replace the existing application with the newer version (latest one), follow the below steps:

Database level changes are also included in the latest WAR file and your current Mifos database automatically gets updated, if there are any changes at schema level.

To upgrade the MIFOS application:

  • Shut down tomcat. Delete the war file from the following location

 “C:\apache-tomcat-6.0.18\webapps\ “

Delete the work folder also

“C:\apache-tomcat-6.0.18\work”

  • Copy the new WAR at

“C:\apache-tomcat-6.0.18\webapps\ “

  • Restart Tomcat

If everything runs fine then you will be able to access the URL

http://<ip address of your server>:8080/mifos

How to solve upgrade error while accessing URL?

Database version less than application one

If SQL upgrades coming up with latest WAR do not run fine and you face the following error while accessing the link


In this condition, go to following location

C:\apache-tomcat-6.0.18\webapps\mifos\WEB-INF\classes\sql

Check the database version coming on screen. In the above screenshot it is ‘230’ and application version is 259. The key is both the versions should match with each other in order to make your application run.

In order to make both 259, we need to upgrade database version 230 to 259.

At mentioned location

C:\apache-tomcat-6.0.18\webapps\mifos\WEB-INF\classes\sql

Taking consideration the above screenshot, we will take a look into the upgrade_to_231.sql script that actually fails while doing upgradation.


Execute the script on your MYSQL command line individually using

Mysql > source <filename> command

 Do the above steps for next two more upgrades. So after running these, check the version of your database in the following table of MIFOS schema using the query below

select * from database_version;

Do not run the entire scripts if they are many upgrades to be done. Just execute the one where the upgrade failed and for rest do the following steps.

  • Shut down tomcat. Delete the war file from the following location

 “C:\apache-tomcat-6.0.18\webapps\ “

 Delete the work folder also

“C:\apache-tomcat-6.0.18\work”

  • Restart Tomcat.

Now check the database version

          select * from database_version;

It should be ‘259’. If not then again find where it failed. Once version is 259, the application will run smoothly.

Application version less than database one

If your application version comes less than the database one when accessing URL, then your WAR file is older than your database. In this case, you just need to replace the existing WAR file with the higher version of MIFOS.

How to change the default configuration, accounting and database settings of Mifos?

These are three files whose defines parameter values are taken as such if we don’t customize it. In order to change these, following steps needs to be done.

  1. Copy the existing files from below location:

C:\apache-tomcat-6.0.18\webapps\mifos\WEB-INF\classes\org\mifos\config\resources\

Files are

  • C:\apache-tomcat-6.0.18\webapps\mifos\WEB-INF\classes\org\mifos\config\resources\applicationConfiguration.default.properties
  • C:\apache-tomcat-6.0.18\webapps\mifos\WEB-INF\classes\org\mifos\config\resources\mainDatabase.properties
  • C:\apache-tomcat-6.0.18\webapps\mifos\WEB-INF\classes\org\mifos\config\resources\mifosChartOfAccounts.xml

Steps to make customized files:

  1. Make a new folder in the root directory with name as “MIFOS_CONF”

           C:\MIFOS_CONF

  1. Change the files with the customized parameter values and save each with extension as following.

C:\MIFOS_CONF\applicationConfiguration.custom.properties

C:\MIFOS_CONF\mainDatabase.properties

C:\MIFOS_CONF\mifosChartOfAccounts.custom.xml

  • Create a user variable ‘MIFOS_CONF”  and set its value with like this


  • Shut down Tomcat
  • Delete the Mifos folder under webapps and work folder
  • Restart Tomcat.

How to solve “503” error when accessing the URL?

The solution is to upgrade the version of your JDK to 1.6