Monday, November 21, 2011

Installing Mondrian

After series of disappointments, I finally figured out how to install mondrian on Mac. Definitely, the documentation at Pentaho was not helpful enough for a beginner like me. So I googled for hours to find sites that would help me. There, I found http://computersight.com/software/how-to-install-mondrian-the-complete-guide/. However, upon executing #12, I encountered this error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/olap4j/mdx/IdentifierSegment at mondrian.test.loader.MondrianFoodMartLoader.(MondrianFoodMartLoader.java:100)

Caused by: java.lang.ClassNotFoundException: org.olap4j.mdx.IdentifierSegment
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 1 more


I thought I must have messed up my classpath. But after looking into it several times, I found that nothing's wrong. Finally, I tried this:

java -cp "/Library/Tomcat/apache-tomcat-7.0.22/webapps/mondrian/WEB-INF/lib/mondrian.jar:/Library/Tomcat/apache-tomcat-7.0.22/webapps/mondrian/WEB-INF/lib/log4j-1.2.8.jar:/Library/Tomcat/apache-tomcat-7.0.22/webapps/mondrian/WEB-INF/lib/eigenbase-xom.jar:/Library/Tomcat/apache-tomcat-7.0.22/webapps/mondrian/WEB-INF/lib/eigenbase-resgen.jar:/Library/Tomcat/apache-tomcat-7.0.22/webapps/mondrian/WEB-INF/lib/eigenbase-properties.jar:/Library/Tomcat/apache-tomcat-7.0.22/webapps/mondrian/WEB-INF/lib/commons-logging-1.0.4.jar:/Library/Tomcat/apache-tomcat-7.0.22/webapps/mondrian/WEB-INF/lib/commons-collections-3.1.jar:/Library/Tomcat/apache-tomcat-7.0.22/webapps/mondrian/WEB-INF/lib/olap4j.jar:/Library/Tomcat/apache-tomcat-7.0.22/webapps/mondrian/WEB-INF/lib/mysql-connector-java-5.1.6-bin.jar" mondrian.test.loader.MondrianFoodMartLoader -verbose -tables -data -indexes -jdbcDrivers=com.mysql.jdbc.Driver -inputFile=/usr/local/mondrian/demo/FoodMartCreateData.sql -outputJdbcURL="jdbc:mysql://localhost/foodmart?user=foodmart&password=foodmart"

And "Yey!", it worked! The error was caused by missing libraries (commons-collections, commons-logging, and olap4j).

Now, I'm studying how to use Mondrian and experimenting on the FoodMart demo.

3 comments:

  1. BUG reported : http://jira.pentaho.com/browse/MONDRIAN-1048

    ReplyDelete
  2. Thanks so much for this post. I was stuck with this problem for hours.

    ReplyDelete
  3. thanks, it does really help me :)

    ReplyDelete