jMarkets v2 Installation Guide

Getting jMarkets

Binary Edition: The latest stable version of jMarkets 2, packaged in WAR (web archive) file, is available from the download page.

Source Edition: If you prefer the source edition, you can download the source, in either zip or tar.gz formats, for the latest jMarkets release from jMarkets download page. See the section Building jMarkets on how to build jMarkets from the source code.

System Requirements

  • OS: jMarkets has been used successfully on many platforms, including Linux, Windows 2000/XP, and MacOS X v10.4 (Tiger).
  • JDK: To build and use the current version of jMarkets, you will also need a JDK, version 1.5.0 or higer, installed on your system. JAVA runtime (JRE) plugin needs to be installed for browsers to access jMarkets client and server applets. The Microsoft JVM/JDK is NOT supported.
  • MySQL: Although jMarkets doesn't use any RDBMS vendor specific features, it has only been tested extensively with MySQL. The latest stable version of MySQL is available from the MySQL download site.
  • Servlet/JSP Container: To use jMarkets, you need a servlet/JSP container installed on the system where jMarkets binary will be deployed. Jakarta/Tomcat (4.x or higher), from Apache Software foundation, is recommended.
  • Ant: To build jMarkets from source, you need Ant 1.6.x or higher.

Installing jMarkets Binary

Binary Content and its Structure

  • Binary archive content
    • jMarkets2.war //jMarkets web application archive
    • sql/ //Directory that contains jMarkets database schema, and initialization script
    • README
  • The jMarkets2.war consists of the following directory layout.
    • css //cascade style sheet
    • jsp //JSPs
    • WEB-INF //jMarkets web applicaton configuration files, dependent libraries, message resources, tag libraries and jMarkets classes.
      • lib //jMarkets dependent libraries
      • classes //jMarkets classes, logging configuration file and message resources
    • META-INF //Meta information about the archive.

Preparation

  • Setting up Tomcat: Installation guide for tomcat is available from Tomcat Homepage under the documentation link on the left navigation panel.
    The directory path to Tomcat installation can NOT contain any white spaces, otherwise jMarkets server will 
    NOT run properly!
    
  • Setting up MySQL: How to set up MySQL on a linux machine is beyond the scope of this document, please refer to the MySQL manual if you have any questions. Assuming MySQL is installed and is up and running, the following steps describe how to set up database for jMarkets v2.
  • Create jMarkets2 database. There are many ways of creating a database, one option is to do it from the MySQL shell.

create database jmarkets2;

  • Create jMarkets2 database user. There are a several ways of setting up user privileges, again the following example shows how to do it from the MySQL shell.

mysql>grant all privileges on jmarkets2.* to jmarkets2@localhost identified by 'banana';

mysql>flush privileges;

If you plan to change the login and password for jMarkets' database user, you will need to modify the jmarkets.properties file in WEB-INF/classes directory.

  • Load jMarkets2 database schema. Here again, we demonstrate the way to load the schema from MySQL shell. Change to the sql directory first.

mysql>use jmarkets2; //switch to jMarkets v2 database

mysql>source jMarkets2.sql;

Alternatively, one can load the schema script by issuing the following command from a command/shell prompt and in directory where jMarkets.sql script is.

command prompt> mysql jmarkets2 -ujmarkets2 -p > jMarkets.sql

  • Load Initial Users. Change to the sql directory first. Modify the init.sql script to suit your need.

mysql>use jmarkets2; //switch to jMarkets v2 database

mysql>source init.sql;

Or from a command/shell prompt and in directory where init.sql script is:

command prompt> mysql jmarkets15 -ujmarkets15 -p > init.sql

Take a look in the init.sql file for default login and password for experimenter as well as for dummy user accounts.

Deployment of jMarkets v2

  • Copy the jMarkets2 WAR file in the webapps directory under your Tomcat installation. Start Tomcat, you should see the WAR file being expanded to jMarkets2 folder. Stop Tomcat and modify the following files:
  • WEB-INF/classes/jmarkets.properties. Adjust the database properties to reflect the database, and database user/password you created earlier.
  • WEB-INF/struts_config.xml. If you plan to change the login and password for jMarkets' database user, you will need to modify the struts_config.xml file in WEB-INF directory."
  • WEB-INF/classes/log4j.properties Modify the file appender path according to your local settings.
  • Start Tomcat again, and you should be able to access jMarkets client at: http://localhost:8080/jMarkets2 (given that your Tomcat is running on port 8080) and jMarkets experimenter at: http://localhost:8080/jMarkets2/ExpLogin

Congratulations! You have just successfully set up jMarkets'''


Building jMarkets v2 From Source

  • Unpack the source archive on a local directory.
  • Use Ant to build a binary WAR file. From command prompt or shell prompt in jMarkets 2 top directory, type:

ant dist //given ant is installed on your system A WAR file will be built and put in the "dist/" directory.

  • You can now deploy the WAR file as described in the Installation section above.