OpenXRI Server Setup using DBStore

Copyright 2006 OpenXRI Fondation
Author :
Distributed under Apache 2.0 License

Document Conventions

In this document following conventions are used,

Pre Install Steps

  1. You need to have a working MySQL Database installed on your local machine.

  2. You should be able to run SQL Scripts against the MySQL Database.

    If you are testing this on Windows and you don't have both Apache and MySQL installed on your machine, you can use the following software. http://www.wampserver.com/

    It will install Apache, MySQL, PHP and also a Software called PHPMyAdmin which can help in WebBased Administration of MySQL Database.

    Caution (Just a Opinion) : http://www.wampserver.com/ is good for local testing. Don't install it on Production Box unless you know how to change passwords for root users.

  3. This is a Important Step. If you miss this, you will not get Database Connection in Tomcat. This step is required if MySQL is used as database.

    Copy the file

    %OPENXRI_HOME%\org.openxri.server\3rdParty\mysql_jars\mysql-connector-java-3.1.11-bin.jar

    to following location,

    %TOMCAT_HOME%\common\lib

    Note: If you already have another working version of MySQL Jar file under Tomcat you can skip this step. Don't have to overwrite any existing files unless a new Version of Hibernate requires a upgraded jar file.

Installing OpenXRI Server on local machine

Next follow these steps,

  1. If there is any project called "openxri" under tomcat, need to remove that one.

  2. Also remove the following file if it's already there, %TOMCAT_HOME%\conf\Catalina\localhost\openxri.xml

  3. Next extract the Zip file vista3.zip to local machine. Hence forth this location will be referred in this document as OPENXRI_HOME.

  4. First we need to setup the Database. Remove any existing database for OpenXRI, (for eg vista2). [Take a back if required]. We will be using PHPMyAdmin in this setup.

  5. Next using PHPMyAdmin run the SQL script available here, %OPENXRI_HOME%\org.openxri.server\schemas\database\mysql_db_script.sql.

    This will create a new Database called "XRI_DB" and will also setup all required tables.

  6. Next we will compile the code base. The code needs to be compiled in following sequence, syntax, client and server.

    If everything compiles without any errors, then we are good.

  7. Next lets create the WAR file for deploying in Tomcat. Goto following folder from command prompt "%OPENXRI_HOME%\org.openxri.server" and run the command "ant war".

    This should create a WAR file that can be deployed in Tomcat. It will create following file, %OPENXRI_HOME%\org.openxri.server\dist\openxri.war

  8. Next lets deploy the codebase in Tomcat. Make sure tomcat is stopped before executing these steps.

TESTING OPENXRI SERVER ON LOCAL MACHINE

After the installation, we want to check if the installation of the OpenXRI server has been successful on local machine.

  1. First lets inserts some test data into database. Open the following file, %OPENXRI_HOME%\org.openxri.server\schemas\database\mysql_sampledata.sql

    Run the above file in PHPMyAdmin against the "XRI_DB" Database

    This will insert some test data into Database.

  2. Note : To Run JUnit, ant requires a Additional Jar File (JUnit.jar) which is not distributed with Ant Binary Files.

    To run the JUnit Test Case, need to do following,

    Put both junit.jar and the optional tasks jar file in ANT_HOME/lib.

    Please refer to http://ant.apache.org/manual/OptionalTasks/junit.html for more details

  3. Open the following file,

    %OPENXRI_HOME%\org.openxri.server\test\org\openxri\store\TestDBStore.java

    And change the constants "CERTIFICATES_LOCATION" and "ROOT_DIR_URL" as required.

  4. Next from command prompt, go to following folder,

    %OPENXRI_HOME%\org.openxri.server

    and then run following command,

    prompt> ant testdbstore

    If all JUnit Test Cases run without any errors, then the OpenXRI server has been Successfully Installed.

  5. Next to remove all the test Data from Database execute following SQL file from PHPMyAdmin,
    %OPENXRI_HOME%\org.openxri.server\schemas\database\mysql_deleteallrecords.sql

    This will reset Database to Original State with Database Tables Created with no Data.