Hitachi Vantara Pentaho Community Wiki
Child pages
  • Building Mondrian CmdRunner on Linux
Skip to end of metadata
Go to start of metadata

Download the perforce repository commandline client p4 at  http://www.perforce.com/perforce/downloads/index.html

Perforce commands:
  ./p4 -p perforce.eigenbase.org:1666 help
Create p4 client:
  ./p4 -p perforce.eigenbase.org:1666 -u guest client
Checkout source:
  ./p4 -p perforce.eigenbase.org:1666 -u guest sync //open/mondrian/...

To delete the client:
  ./p4 -p perforce.eigenbase.org:1666 -u guest client -d <yourclientname>

Install jdk1.5, jdk1.6  (binary install)
Install ant (yum) (1.6.5)

Copy the database driver into place so it is packaged with the cmdrunner jar.
  cp ~/mysql-connector-java-5.1.6.jar ./lib

  cd open/mondrian
Set JAVA_HOME in build script:
  vi buildJdk16.sh

Set the shell environment
  export JAVA_HOME=/<yourpathtojdk>/jdk1.5.0_16
  export PATH=$JAVA_HOME/bin:$PATH

Using jdk1.6 gives the error:
/opt/dev/mondrian/open/mondrian/src/main/mondrian/olap4j/FactoryJdbc3Impl.java:73:
mondrian.olap4j.FactoryJdbc3Impl.MondrianOlap4jPreparedStatementJdbc3 is not abstract
and does not override abstract method setNClob(int,java.io.Reader) in java.sql.PreparedStatement

Run the build:
  ant cmdrunner

build.xml fails on line 1116 "type doesn't support osfamily attribute":

remove osfamily attribute and replace with os:

   vi build.xml and modify line 1116 and 1117

   <exec os="unix" executable="${unix.script}"/>
   <exec os="windows" executable="buildJdk16.bat"/>

The build does not add  log4j.dtd or log4j.properties so add manually. You may wish to alter the logging settings of log4j.properties and log4j.xml. log4j.xml is already included in commandrunner.jar but you may have altered the logging options so update it too.

First extract the dtd file from the log4j.jar:

jar -xvf ../log4j.jar org/apache/log4j/xml/log4j.dtd
  inflated: org/apache/log4j/xml/log4j.dtd

Now update/add the files to cmdrunner.jar:

jar -uvf cmdrunner.jar org log4j.properties log4j.xml
  adding: org/(in = 0) (out= 0)(stored 0%)
  adding: org/apache/(in = 0) (out= 0)(stored 0%)
  adding: org/apache/log4j/(in = 0) (out= 0)(stored 0%)
  adding: org/apache/log4j/xml/(in = 0) (out= 0)(stored 0%)
  adding: org/apache/log4j/xml/log4j.dtd(in = 4913) (out= 1489)(deflated 69%)

To run:

Configure mondrian.properties to contain settings eg:

mondrian.catalogURL=file:///opt/work/mondrian_query/depana.xml
mondrian.test.jdbcURL=jdbc:mysql://192.168.10.5/ems_dev?user=dev&password=dev
mondrian.jdbcDrivers=com.mysql.jdbc.Driver
mondrian.rolap.RolapUtil=com.mysql.jdbc.Driver
 
Create the sample schema file for catalogURL.

java -jar lib/cmdrunner.jar