Skip to content
keithwoodlock edited this page Sep 8, 2012 · 52 revisions

mifosx

This page lists out the instructions for getting started on mifosx for Developers.

Github & Git

see Github-&-Git

Gradle Setup

Gradle 1.0 or later Installed

Download gradle from www.gradle.org, be sure to following instructions for installation at http://gradle.org/docs/current/userguide/installation.html

Test gradle installation:

gradle -version

This should output some information about version of gradle you are using. It must be the 1.0 release version at a minimum.

Important environment variables of interest:

GRADLE_HOME e.g. C:\dev\gradle-1.0

JAVA_HOME e.g. C:\dev\java\jdk6_u30

JAVA_OPTS e.g. -Xms512m -Xmx512m -XX:MaxPermSize=512m

Configure gradle.bat or gradle.sh to support remote debugging

In GRADLE_HOME/bin, edit the gradle.bat/gradle.sh (depending on OS) and update the line near top of file from

set DEFAULT_JVM_OPTS=

to

set DEFAULT_JVM_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8005,server=y,suspend=n

Note: This is better than putting remote debugging JVM parameters into JAVA_OPTS.

Eclipse Setup

Instructions for using eclipse for development on mifosx.

Eclipsify your application

  • Move into the mifosng-provider directory.

Execute the following: gradle clean cleanEclipse eclipse

when this finishes do gradle clean war

Note: gradle tasks shows all tasks that can be executed in each directory.

Import project into eclipse

Create a new directory for your eclipse workspace. e.g. c:/dev/eclipse-workspaces/mifosx-github

Start up Eclipse (assuming its already installed)

Use the workspace directory you just created.

When opened, in the package explorer of the java perspective, right-click import->General->Existing projects into workspace. In the dialog that opens, specify the root directory option by browsing to and selecting the mifosx directory that was cloned e.g. c:/dev/githubrepos/mifosx

This show pick up on the mifosng-provider project you just 'eclipsified' in last step. Click Finish to import into workspace.

Note: You may see eclipse warning to do with 'Serializable'. Goto Window->Preferences->Java->Compiler->Errors/Warnings. In the Potential programming problems section choose 'ignore' for 'Serializable class without serialVersionUID:' option.

Remote debugging through eclipse

On the debugger (see menu icon that looks like a bug/spider), choose Debug configurations...

  1. Select Remote Java Application from list of configurations and click the icon on top for New launch configuration
  2. For name enter something like: Remote debug mifosx platform
  3. In connect tab, ensure the following
    • project: mifosng-provider
    • Host: localhost
    • Port: 8005 (or whatever you chose when adding remote debugging paramaters in the setting up gradle section)
  4. In common tab, tick of dispay in favourites for Debug

Apply/Save these changes and select the saved launch configuration from your debug menu to attach the debugger to the already running mifosx platform (if the platform isnt running you will get message from eclipse saying it cant attach to JVM etc)

Database setup

Assuming you already have a version of MySql installed. To get started quickly you can just setup the latest demo database.

Mifos X has support for hosting multiple tenants.

Create schema/database named mifosplatform-tenants

create database 'mifosplatform-tenants';

Then apply file; mifosng-db/multi-tenant-demo-backups/0001-mifos-platform-shared-tenants.sql

mysql -u[user] -p[password] mifosplatform-tenants < mifosng-db/multi-tenant-demo-backups/0001-mifos-platform-shared-tenants.sql

Create schema/database named mifostenant-default.

create database 'mifostenant-default';

Then apply file; mifosng-db/multi-tenant-demo-backups/mifostenant-default.backup.sql to this database;

mysql -u[user] -p[password] mifostenant-default < mifosng-db/multi-tenant-demo-backups/mifostenant-default.backup.sql

Starting the Mifos X Platform From The Command Line.

If Using Different MySQL User/Password than what is configured

Note: When launching the platform from the command line for developement, the user/password used for the database is root/mysql. If your root user password for mysql is different, you should change the password in the file mifosng-provider/src/test/resources/META-INF/context.xml

Also, you want to update the schema settings associated with each entry in the mifosplatform-tenants database:

Example of updating tenant with id 1 to use mifos/mifos as username/password for database connections.

UPDATE mifosplatform-tenants.tenants SET schema_server = 'localhost', schema_server_port = '3306', schema_username = 'mifos', schema_password = 'mifos' WHERE id=1;

Commands

Open up a terminals or command prompt.

On terminal, move into the mifosng-provider directory and execute gradle clean tomcatRunWar

If all has gone well, the platform should be available at: https://localhost:8443/mifosng-provider/api/v1/offices?tenantIdentifier=default

You should be able to log into platform with Username: mifos and Password: password.

For client applications built on top of the platform see the https://github.com/keithwoodlock/mifosx-community-apps repository.

Troubleshooting Help

BindException Errors

If you get the java.net.BindException: Address already in use :8080 exception whilst running the gradle command inside the mifosng-provider directory, you may need to kill the process which is already using 8080 (netstat -aon | grep 8080).