Hitachi Vantara Pentaho Community Wiki
Child pages
  • Installing Pentaho & Liferay in Glassfish
Skip to end of metadata
Go to start of metadata

Install Liferay with GlassFish Bundle

What you will need

  • JDK 1.6.x/1.5.x (Only 1.5.x on Mac)
  • Apache Ant

Install Steps

  1. Download Liferay bundled with Glassfish for your platform from http://www.liferay.com/web/guest/downloads/portal
  2. java -Xmx256m -jar liferay-portal-glassfish-(platform)-(version).jar -console
  3. cd glassfish
  4. ant -f setup.xml
  5. ./bin/asadmin start-domain

Wait for ~ 1min for glassfish and liferay to initialize.

Access Portal at http://localhost:8080/portalThe first request will take a while to respond since JSPs are compiled.

Generating a Pentaho war for Glassfish

Get the latest from the liferay-demo branchsvn://source.pentaho.org/svnroot/pentaho/branches/liferay-demo .

Build the pentaho.war for Glassfish by selected for following target.



 

Creating Pentaho Datasources in 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.

   

      If you are not able to get this working, you can go to the admin section of the appserver and add the resources manually. You will end you updated the domain.xml in the config folder of your domain in glassfish.

domain.xml
<jdbc-resource enabled="true" jndi-name="jdbc/Quartz" object-type="user" pool-name="PentahoQuartzPool">
      <description>Quartz</description>
    </jdbc-resource>
    <jdbc-resource enabled="true" jndi-name="jdbc/SampleData" object-type="user" pool-name="PentahoSampleDataPool">
      <description>SampleData</description>
    </jdbc-resource>
    <jdbc-resource enabled="true" jndi-name="jdbc/Hibernate" object-type="user" pool-name="PentahoHibernatePool">
      <description>Hibernate</description>
    </jdbc-resource>
    <jdbc-resource enabled="true" jndi-name="jdbc/SampleDataAdmin" object-type="user" pool-name="PentahoSampleDataAdminPool">
      <description>SampleDataAdmin</description>
    </jdbc-resource>

    <jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="org.hsqldb.jdbc.jdbcDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="false" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" name="PentahoHibernatePool" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.DataSource" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="false">
      <description>Pentaho Hibernate Pool</description>
      <property name="password" value="password"/>
      <property name="username" value="hibuser"/>
      <property name="database" value="jdbc:hsqldb:hsql://localhost/hibernate"/>
    </jdbc-connection-pool>
    <jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="org.hsqldb.jdbc.jdbcDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="false" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" name="PentahoSampleDataPool" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.DataSource" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="false">
      <description>Pentaho SampleData Pool</description>
      <property name="password" value="password"/>
      <property name="database" value="jdbc:hsqldb:hsql://localhost/sampledata"/>
      <property name="username" value="pentaho_user"/>
    </jdbc-connection-pool>
    <jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="org.hsqldb.jdbc.jdbcDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="false" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" name="PentahoSampleDataAdminPool" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.DataSource" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="false">
      <description>Pentaho SampleDataAdmin  Pool</description>
      <property name="password" value="password"/>
      <property name="database" value="jjdbc:hsqldb:hsql://localhost/sampledata"/>
      <property name="username" value="pentaho_user"/>
    </jdbc-connection-pool>
    <jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="org.hsqldb.jdbc.jdbcDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="false" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" name="PentahoQuartzPool" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.DataSource" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="false">
      <description>Pentaho Quartz Pool</description>
      <property name="password" value="password"/>
      <property name="database" value="jdbc:hsqldb:hsql://localhost/quartz"/>
      <property name="username" value="pentaho_user"/>
    </jdbc-connection-pool>

   
 

Getting Pentaho & Liferay up and running in Glassfish


  1. Start  liferay add a plugin by uploading a file.
  2. Browse to where the workspace is then to pentaho/build/pentaho-wars/tomcat/mysql5
  3. Copy pentaho-portal-layout.war, pentaho-style.war and sw-style.war into autodeploy directory of glassfish.
  4. Copy the pentaho-solution directory as a sibling of the glassfish installation folder
  5. start glassfish on a already setup domain.
  6. login to liferay using test@liferay.com/ test .
  7. add the Plugin Installer portlet and import the pentaho.war into liferay.
  8. Here comes the catch. There seems to be a problem with either Liferay or Glassfish. It tries to unpack the war and in the process modifies pentaho's web.xml and add a > string at the end of a random line.
  9. Once you see that the war deploy has failed, go to the autodeploy folder of glassfish and open the pentaho.war and updated the web.xml by removing that string from the line.
  10. Once you do that it will redeploy the war and this time it will be successful.
  11. Restart the glassfish application server.
  12. Login to Liferay and now you will be able to see the pentaho portlet category.
  13. Add the portlet to any page and enjoy.


 

  • No labels

2 Comments

  1. I'm trying to integrate Pentaho with Liferay on Glassfish V3.
    I don't find the liferay-demo branch in svn repository.

    Does somebody know where to found it ?

     Thanks in advance !

  2. Anonymous

    @Michael

    svn://source.pentaho.org/svnroot/legacy/pentaho/branches/liferay-demo