Top | Web home | SourceForge home SourceForge.net Logo
$Id: //guest/julian_hyde/mondrian/doc/install.html#8 $
(C) Copyright 2002, Kana Software, Inc.
Author Julian Hyde

How to build and install Mondrian

1. Contents

  1. Contents
  2. Modification history
  3. Setup build environment
  4. Build
  5. Run the demo
  6. Run the web app
  7. Debug tomcat using IntelliJ
  8. Miscellaneous
    1. Coding guidelines
  9. Appendix A: Product instllation instructions

2. Modification history

Date Revision Author Comment
February 7th, 2002 1 Julian Hyde Created
March 5th, 2002 2 Julian Hyde Tomcat install
March 28th, 2002 3 Julian Hyde Xalan, JUnit and Oracle.
Moved product info to an appendix.

3. Setup build environment

Here are the steps to setup a build environment.

  1. Install JDK 1.3.1.
  2. Install Ant.
  3. Install Tomcat.
  4. Install Xalan.
  5. Install JUnit.
  6. Go to ${xalan.home}/bin, and copy xalan.jar and xml-apis.jar to ${tomcat.home}/common/lib. (This shouldn't be necessary, because these JARs are in mondrian.war, but I think there's a bug in Tomcat/4.0.3.)
  7. Modify build.bat, setting JAVA_HOME, ANT_HOME, TOMCAT_HOME, XALAN_HOME, JUNIT_HOME.

Optional:

  1. Install Jikes.

4. Build

As follows:

cd ${project.location}
build

5. Run the demo

You first need a database. I wanted to distribute a hsqldb database, but when loaded and indexed, the 300,000 rows/20Mb data set turned into a 400Mb datafile. So, two choices:

  1. If you have Microsoft Access, create a System ODBC DSN called MondrianFoodMart pointing to ${project.location}/demo/access/FoodMart.mdb. The JDBC connect string will be jdbc:odbc:MondrianFoodMart.
  2. If you have Oracle, create the dataset by importing ${project.location}/demo/oracle/FoodMart.dmp. Setup your environment:
    1. Set ORACLE_HOME in build.bat, or in your environment.
    2. Append %ORACLE_HOME%/jdbc/lib/classes12.zip to CLASSPATH in build.bat, or in your environment.
    3. In build.xml, make sure that the property mondrian.jdbcDrivers includes oracle.jdbc.OracleDriver.
    4. In build.xml, set the property mondrian.foodmart.jdbcURL. It should probably include a username and password, for example jdbc:oracle:oci8:foodmart/foodmart@myoracle.
  3. If you have another database, create and populate the schema by running the scripts FoodMartTables.sql, FoodMartData.sql and FoodMartIndexes.sql in ${project.location}/demo/. You may need to modify the scripts for your database's particular DDL syntax. Examples:

Edit the "FoodMartTest" target in build.xml.

Run

cd ${project.location}
build test

6. Run the web app

  1. First install Tomcat, as above.
  2. Make sure the web.xml file in ${project.location}/webapp/WEB-INF is correct for your environment. In particular, check the paths in the init parameters to MDXQueryServlet.
  3. build deploy-webapp.
  4. Start up tomcat.
  5. Hit http://localhost:8080/mondrian.

7. Debug tomcat using IntelliJ

  1. add ${tomcat.home}/webapps/mondrian.war to intellij's classpath
  2. edit ${tomcat.home}/bin/catalina.bat as follows:
    :doJpda
    if not "%SECURITY_POLICY_FILE%" == "" goto doSecurityJpda
    %_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% -Xdebug -Xnoagent
      -Xrunjdwp:transport=dt_socket,address=%JPDA_ADDRESS%,server=y,suspend=n %DEBUG_OPTS%
      -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%"
      -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%"
      -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%
    goto end
  3. create ${tomcat.home}/bin/setenv.bat as follows:
    set JPDA_ADDRESS=5000
  4. cd e:\jakarta-tomcat-4.0.3\bin
  5. catalina jpda run
  6. attach intellij's debugger to port 5000

8. Miscellaneous

8.1. Coding guidelines

Appendix A. Product installation instructions

These are the products I used to build mondrian. Install all of the products marked 'required'. (I use /-es in paths because I am run MKS on Windows 2000, and it makes things simpler.)

In the following, the symbol ${project.location} means the root of your source tree.

Where the instructions suggest setting an environment variable, it is often sufficient to edit the corresponding line in ${project.location}/build.bat.

Product Required? Version Comment
JDK Yes 1.1 or later (I use version 1.3.1.) Available from http://developer.java.sun.com/. I downloaded j2sdk-1_3_1_02-win.exe, and extracted to E:/jdk1.3.1_02. Set JAVA_HOME to same, and CLASS_PATH to %JAVA_HOME%/lib/dt.jar.
Ant Yes 1.4.1 or later  I downloaded jakarta-ant-1.4.1-bin.zip, extracted to E:/jakarta-ant-1.4.1, and set ANT_HOME to the same.
Tomcat Yes 4.0 or later (I use version 4.0.3) Available from http://jakarta.apache.org/tomcat. I downloaded jakarta-tomcat-4.0.3.zip, extracted to E:/jakarta-tomcat-4.0.3, and set TOMCAT_HOME to the same.
Jikes No   Available from http://oss.software.ibm.com/developerworks/opensource/jikes/. I downloaded jikes-1.15-windows.zip, and extracted jikes.exe to C:/winnt/system32. Then uncomment the relevant lines of ${project.location}/build.properties.
Xerces   1.4.1 or later xerces.jar is included with Tomcat.
Xalan Yes 2.3.1 or later Available from http://xml.apache.org/xalan-j/. I downloaded xalan-j_2_3_1-bin.zip, extracted to E:/xalan-j_2_3_1, and set XALAN_HOME to the same.
JUnit Yes 3.7 or later Available from http://www.junit.org/. I downloaded junit3.7.zip, extracted to E:/junit3.7, and set JUNIT_HOME to the same.
Intellij IDEA (a Java IDE) No 2.5.1 You can download a 30-day evaluation copy from http://www.intellij.com/idea/. Follow the instructions in Install.txt in idea-2_5_1.zip to there.

Create a project ${project.location}/mondrian.ipr. Set the compiler output path to ${project.location}/classes/. Add javacup.jar and xerces.jar in ${project.location}/lib/ to the class path.

To use Ant build, click the '6: Ant Build' tab, click '+', choose ${project.location}/build.xml, then right-click, choose 'Properties', and choose 'Include project classpath'. (javacup.jar is needed in order to build the parser target.)

hsql Database Engine No 1.61

Available from http://hsqldb.sourceforge.net/. I extracted hsqldb_v.1.61.zip to E:/hsqldb_v.1.61, then edited bin/run.bat. You will need to add hsqldb.jar to your classpath.

mySQL No ? ?
Postgres No ? ?
JavaCUP (parser generator) Included with source distribution, as lib/javacup.jar v0.10g (with modifications) Available from http://www.cs.princeton.edu/~appel/modern/java/CUP/. I modified version v.0.10g to add an Ant task, and to output error messages in a format which Emacs can parse.

 

End $Id: //guest/julian_hyde/mondrian/doc/install.html#8 $