Hitachi Vantara Pentaho Community Wiki
Child pages
  • Pentaho Glassfish Deployment
Skip to end of metadata
Go to start of metadata

Orginal tutorial Installation of Pentaho BI Suite on Glassfishprovided by jglore, available here 

1. Download the necessary software: Pentaho Business Intelligence Suite, Glassfish, MySQL, and extra libraries.

Pentaho Business Intelligence Suite (1.6.0 Open Source GA) files from here:

Unzip these files into $PENTAHO_INSTALL_DIR. You should have three folders in this directory: data, solutions, and J2EE deployments.


Choose the glassfish-installer-v2ur1-b09d-<platform>.jar file that matches your environment


Download the following jar files:

2. Install Glassfish

  • Follow the unbundle and install instructions on the Glassfish web site
  • For help with Glassfish, see the Glassfish Quick Start Guide at
  • Make sure to add $GLASSFISH_INSTALL_DIR/bin/ to the PATH environment variable
  • If the Glassfish server is not running, then start the server by entering this command: asadmin start-domain domain1
  • When the server has started, this message appears: *{{Domain domain1 is ready to receive client requests.Additional services
    are being started in the background.}}*

3. Install and configure MySQL for Pentaho.

  • On Windows:
    • Open the MySQL Command Line Client from Start->MySQL->MySQL Server 5.0
    • Enter the root database password when prompted
    • At the mysql> prompt, type source $<path_to__file>/SampleDataDump_MySql.sql
  • On Solaris:
    • At the command line, run mysql -u root -p
    • Enter the root database password when prompted
    • At the mysql> prompt, type source $<path_to__file>/SampleDataDump_MySql.sql
  • Verify that you can login to MySQL as the necessary Pentaho users (hibuser, pentaho_user, and pentaho_admin)
  • At the command line, type mysql -u <user> -p
  • Run this command for the three Pentaho users listed above
  • When prompted for the password, enter password
  • If you are unable to login (i.e get an Access denied error), then follow these steps to grant privileges and set the password for the Pentaho users:
  • At the command line, type mysql -u root -p and enter your mysql root password when prompted

At the mysql prompt, type:

use mysql;
grant all privileges on *.* to hibuser;
grant all privileges on *.* to pentaho_user;
grant all privileges on *.* to pentaho_admin;
set password for 'hibuser'@'localhost' = PASSWORD('password');
set password for 'pentaho_user'@'localhost' = PASSWORD('password');
set password for 'pentaho_admin'@'localhost' = PASSWORD('password');
flush privileges;
  • You should now be able to login as hibuser, pentaho_user, pentaho_admin with the appropriate password using mysql -u <user> -p
  • If you have problems with the users, try to create the users with:
  • create user 'pentaho_user'@'localhost';
  • create user 'pentaho_admin'@localhost;
  • create user 'hibuser'@localhost;

4. Build Pentaho for Glassfish

Make the following modifications to $PENTAHO_INSTALL_DIR/pentaho_j2ee_deployments-1.6.0.GA.863-a/

  • Add the following parameters:
    • rdbms=mysql5
    • ear.dir=${build.res.dir}/ear
    • tomcat5.dir=${build.wars.dir}/tomcat/${rdbms}
    • staging.resources=pentaho-res
  • Change the following parameters:
    • data.dir should point to $PENTAHO_INSTALL_DIR/pentaho-data
    • solutions.dir should point $PENTAHO_INSTALL_DIR/pentaho-solutions

Under $PENTAHO_INSTALL_DIR/pentaho_j2ee_deployments-1.6.0.GA.863-a, create the directory structure build/pentaho-ears/orion.
The ant build willplace the ears in this directory.

Modify $PENTAHO_INSTALL_DIR/pentaho_j2ee_deployments-1.6.0.GA.863-a/pentaho-webapp/WEB-INF/web.xml.

  • Change the value of "solution-path" to the $PENTAHO-INSTALL-DIR/pentahosolutions Example: C:\pentaho\pentaho-solutions

In $PENTAHO_INSTALL_DIR/pentaho_j2ee_deployments-1.6.0.GA.863-a/pentaho-res/ear/application.xml

  • Delete all the additional java modules referring *-ds.xml files. The modified application.xml file is here.

    These modules create datasources in JBoss and hence are needed only for a Jboss compatible ear. For glassfish though, we create connection pools and data resources manually, through the admin console or by using the asadmin command-line tool.

In $PENTAHO_INSTALL_DIR/pentaho_j2ee_deployments-1.6.0.GA.863-a/pentaho-res/orion/data-sources.xml,modify all the data source's connection-driver and url values to indicate mysql, rather than hsql. Below is an example of the Hibernate data source. Replicate it for all the other data sources in the file.

  • {{<data-sourceclass="com.evermind.sql.DriverManagerDataSource"name="Hibernate"location="jdbc/HibernateDS"
  • Verify that connection.username and connection.password params in $PENTAHO_INSTALL_DIR/pentaho_j2ee_deployments-1.6.0.GA.863-a/pentaho-res/hibernate/mysql5/hibernate.cfg.xml reflect the username and password for the database at jdbc:mysql://:3306/hibernate. By default, the values are "hibuser" and "password".
  • Copy the 3 jar files (dom4j, jaxen, mysql-connector-java), which were downloaded earlier, to $PENTAHO_INSTALL_DIR/pentaho_j2ee_deployments-1.6.0.GA.863-a/pentaho-third-party
  • Rename the file metadata_mysql5.xmi to metadata.xmi in $PENTAHO_INSTALL_DIR/pentaho-solutions/samples

Build Pentaho

  • To build Pentaho, you must have ant installed on the system. Ant can be downloaded from It is also available in the Glassfish lib directory.
  • From $PENTAHO_INSTALL_DIR/pentaho_j2ee_deployments-1.6.0.GA.863-a, run ant war-pentaho-tomcat-mysql.
  • Make sure that you see "Build Successful" before continuing.
  • From $PENTAHO_INSTALL_DIR/pentaho_j2ee_deployments-1.6.0.GA.863-a, run ant build-orion2.0.5-ear.
  • Make sure that you see "Build Successful" before continuing.
  • This command will create pentaho.ear in $PENTAHO_INSTALL_DIR/pentaho_j2ee_deployments-1.6.0.GA.863-a/build/pentaho-ears/orion.

5. Deploy Pentaho on Glassfish

  • Create JDBC Connection Pools and Resources associated with the database you have created. This can be done either through the Glassfish admin console or via asadmin at the command line.
  • For this scenario, pools and resources were created for the Sample Database only (i.e. quartz,hibernate, sampledataAdmin, and sampledata).
  • Run the command $GLASSFISH_HOME/bin/asadmin add-resources glassfish-pentaho-ds.xml.
  • The glassfish-pentaho-ds.xml used in this scenario is at the bottom of this page.
  • You should see that the add resources completed successfully.
  • For naming the resources jdbc/Quartz, jdbc/Hibernate, jdbc/SampleDataAdmin and jdbc/SampleData, the web.xml syntax from above was used.
  • To verify the connection pools, ping them using the command asadmin pingconnection-pool <connection-pool-name>.
  • Connection pool names can be retrieved from the glassfish-pentahods.xml file.
  • Deploy pentaho.ear
  • Command-line deployment
  • Deploy via asadmin using the command asadmin deploy --user=<adminuser> <path to pentaho.ear>
  • GUI deployment
  • Login to Glassfish Admin Server
  • Browse to Common Tasks ->Deploy Enterprise Applications/Modules
  • Add the following information:
  • Type = Enterprise Application (.ear)
  • Location = path to pentaho.ear file (choose to either upload or make accessible to server locally)
  • Application Name = Pentaho
  • Virtual Server = server
  • Select OK
  • To verify, go to http://localhost:8080/pentaho/Home and try out Pentaho
  • Select one of the valid users in the drop in box and login

The above deployment only allows for access to the Pentaho application from a browser that is local to the application server instance.
To enable remote client (browser) access to the application, locate the following parameter in $PENTAHO_INSTALL_DIR/pentaho_j2ee_deployments-1.6.0.GA.863-a/pentahowebapp/WEB-INF/web.xml
and modify the base-url parameter vaue to the actual server name

Additionally, the Pentaho folders need to be accessible to the application server for sample data to be available to the application.

<?xml version="1.0" encoding="UTF-8"?>
<\!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
  <display-name>Pentaho BI Platform</display-name>
<?xml version="1.0" encoding="UTF-8"?>
<\!DOCTYPE resources PUBLIC
"-//Sun Microsystems Inc.//DTD Application Server 9.1 Domain//EN"
  <jdbc-connection-pool name="pentahoHibernate"
   <property name="user" value="hibuser"/>
   <property name="password" value="password"/>
   <property name="url" value="jdbc:mysql://:3306/hibernate"/>
  <jdbc-resource enabled="true" jndi-name="jdbc/Hibernate"
    object-type="user" poolname="pentahoHibernate"/>
  <jdbc-connection-pool name="pentahoSampledata"
   <property name="user" value="pentaho_user"/>
   <property name="password" value="password"/>
   <property name="url" value="jdbc:mysql://:3306/sampledata"/>
  <jdbc-resource enabled="true" jndi-name="jdbc/SampleData"
    object-type="user" poolname="pentahoSampledata"/>
  <jdbc-connection-pool name="pentahoSampledataAdmin"
   <property name="user" value="pentaho_admin"/>
   <property name="password" value="password"/>
   <property name="url" value="jdbc:mysql://:3306/sampledata"/>
  <jdbc-resource enabled="true" jndi-name="jdbc/SampleDataAdmin"
    object-type="user" poolname="pentahoSampledataAdmin"/>
  <jdbc-connection-pool name="pentahoQuartz"
   <property name="user" value="pentaho_user"/>
   <property name="password" value="password"/>
   <property name="url" value="jdbc:mysql://:3306/quartz"/>
  <jdbc-resource enabled="true" jndi-name="jdbc/Quartz"
    object-type="user" poolname="pentahoQuartz"/>

Other useful resources :
Manual Deployment of Pentaho
Preconfigured Installation of Pentaho
JDBC connection pool and resources
MySql commands for beginners

  • No labels


  1. Hello,

    I'd suggest a few corrections to this document.

    1. Regarding the SampleDataDump_MySql.sql file downloaded from trunk. At the moment please check this file for the text CREATE MEMORY TABLE DATASOURCE which is a bug discussed here . I.e. remove "MEMORY " and add "ENGINE=MEMORY ; " to the end of the statement.

    2. Regarding the datasource XML file on this page, I had to make the following adjustments:

    a. remove the first backslash on DOCTYPE row.

    b. Modify all occurences of attribute datasourceclassname to datasource-classname

    c. Modify all occurences of attribute poolname to pool-name

    3. In order to make a ping to the connection pool I had to put JDBC driver jar in the lib directory just below Glassfish domain directory. E.g. cp ../downloads/mysql-connector-java-5.1.6/mysql-connector-java-5.1.6-bin.jar


    After this I had to restart the Glassfish domain in order to include the JDBC jar in the classpath. Restarting a domain appears to be done like this:

    asadmin stop-domain

    asadmin list-domains (to verify stopped status)

    asadmin start-domain

    4. A side note regarding MySQL connectivity and authorization. This page cover many 'Access denied' problem that may occur

    Perhaps my corrections aren't the most efficient but they helped me installing Pentaho on Glassfish.


    Anders Eriksson

  2. I recently did this with Pentaho 1.7.1 to Glassfish v2ur2, and found a few things:

    • Not necessary to download jaxen and dom4j JARs, they're already there
    • The build.xml targets are slightly different, I used war-pentaho-tomcat-oracle10g (because I was using Oracle) and ear-pentaho-orion2.0.5 (apparent change in target name)
    • I encountered an error: org.apache.commons.vfs.FileSystemException: Multiple providers registered for URL scheme "solution". This was the root cause of a long stack trace. For the work around I used, see
    • In another test of glassfish with mysql, I encountered a problem with not finding a data source at the expected JNDI name. Unfortunately I don't have the exception right now. Investigating that led me to this thread at,, which describes the sun-web.xml file, which is the proprietary extension to web.xml just like jboss-web.xml and others.

    --Jeff Wright, ThotWave Technologies