« Back to Custom Deployments

Geronimo and Tomcat

Install Liferay with Geronimo and MySQL#

This page is a copy of the one from the Apache Geronimo website located at http://cwiki.apache.org/GMOxDOC11/configuring-portals-liferay.html One important point to note is that using the Geronimo management interface to perform these tasks does not currently seem to work. There is an apparent problem when using the Database Pool Wizard to create the database connection or Deploy New to install a new application. The resulting database connection is stored as console.dbpool rather than liferay.liferay-pool so Liferay will not connect. Using the command line works correctly.

Only Geronimo 1.1.1 has been tested with this doc.

Install Liferay Plugin via Command Line #

We will download the plugin manually first and then create a custom connection pool to use an external database.

Download the plugin from http://www.liferay.com/web/guest/downloads and look into the Application Server Plugins section. You should find something similar to this:

 Geronimo: liferay-portal-geronimo-tomcat-4.3.1.car 
 For this particular case, Liferay portal 4.3.1 for Geronimo Tomcat distribution.

We mentioned earlier that we would use a different database for this example so now we will provide additional steps for configuring the remote database. We assume you have already installed MySQL 5.

Prebundled Geronimo + Tomcat#

As of Liferay 4.3.6 there is no need to install using a plugin. A prebundled geronimo + tomcat distribution is available: [http://downloads.sourceforge.net/lportal/liferay-portal-geronimo-tomcat-4.3.6.zip?modtime=1199902195&big mirror=1

This is a summary of the required steps:

1 Liferay with Geronimo#Create database schema and populate initial data]. Manually create the lportal database and tables using the MySQL script.

2 Extract clean download of the bundle.

3 Launch Geronimo, noting that everything boots without error.

4 Liferay with Geronimo#Delete the Derby database connection pool. Undeploy the Derby database pool using the command prompt.

5 Liferay with Geronimo#Create the required database connection pool

5a Install latest MySQL connector jar using the Geronimo console.

5b Deploy MySQL database pool using the command prompt.

6 Close Geronimo

7 Delete the following directories:

 <liferayhome>/repository/liferay/liferay-portal-tomcat 

&

 <liferayhome>/repository/liferay/liferay-tunnel-tomcat

8 Liferay with Geronimo#Reboot Geronimo and Tomcat bundle. Reboot Geronimo ...

9 Delete the Derby lportal database from >Embedded DB>DB Manager in the Geronimo console, (http://localhost:8080/console/portal/internalDB/internalDB_DBManager).

Each of these steps are discussed in detail below.

Create database schema and populate initial data#

  • Download and extract the database schema scripts available on http://www.liferay.com/web/guest/downloads , see Database Scripts.
  • Create and populate the portal database, for this particular case we will be using create-mysql.sql from a MySQL command line client run
 \. <scripts_home>\create\create-mysql.sql

Windows:

 mysql>source C:/<scripts_home>/create/create-mysql.sql

Note that this command may take some time to run. This concludes the initial database configuration, now we need to define a connection pool in Geronimo.

Delete the Derby database connection pool#

If you are using the geronimo + tomcat bundle available from 4.3.6 then it is first necessary to delete the Derby database pool with which the bundle ships.

There is a localhost:8080/console way to do this, but this seems to throw an error, so therefore undeploy the pool using the command prompt.

First, ensure that Geronimo has started without error. Then at the command prompt:

 bin>deploy --user system --password manager undeploy liferay/liferay-pool/4.3.6/car

If everything is OK, you should see an output like this:

 Using GERONIMO_BASE:   c:\Programs\Liferay              
 Using GERONIMO_HOME:   c:\Programs\Liferay              
 Using GERONIMO_TMPDIR: c:\Programs\Liferay\var\temp     
 Using JRE_HOME:        c:\\Programs\Java\jdk1.5.0_14        
   Module liferay/liferay-pool/4.3.6/car unloaded.         
   Module liferay/liferay-pool/4.3.6/car uninstalled.                                                              
   Undeployed liferay/liferay-pool/4.3.6/car           

Create the required database connection pool#

Liferay portal server plugin will be expecting to find a connection pool named LiferayPool and with the following moduleId liferay/liferay-pool/4.3.1/car. So we will create a deployment plan and deploy this connection pool from the command line.

Before we can deploy the connection pool we need to install in Geronimo the appropriate MySQL connector drivers. This is a simple task to do, follow these steps from the Geronimo Administration Console:

  • Download the mysql-connector-java from the MySQL Downloads site. For this particular case we will be using mysql-connector-java-5.0.6-bin.jar.
  • (Confirm : mysql-connector-java-5.1.5-bin.jar works with 4.3.6 bundle)
  • From the Geronimo Administration Console click on Common Libs.
  • Click on Browse and specify the location for the mysql-connector-java-5.0.6-bin.jar file you just downloaded.
  • Make sure the remaining fields reflect the following values:
      Group: 	mysql
      Artifact: 	mysql-connector-java
      Version: 	5.0.5
      Type: 	jar
  • Click on Install, this will copy the drivers into the local Geronimo repository.

Now we are ready for the next step, deploy the connection pool.

Create a deployment plan named liferay-pool_mysql.xml as shown in the following example.

 liferay-pool_mysql.xml
 <?xml version="1.0" encoding="UTF-8"?>
 <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.1">
    <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
        <dep:moduleId>
            <dep:groupId>liferay</dep:groupId>
            <dep:artifactId>liferay-pool</dep:artifactId>
            <dep:version>4.3.1</dep:version>
            <dep:type>car</dep:type>
        </dep:moduleId>
        <dep:dependencies>
            <dep:dependency>
                <dep:groupId>mysql</dep:groupId>
                <dep:artifactId>mysql-connector-java</dep:artifactId>
                <dep:version>5.0.6</dep:version>
                <dep:type>jar</dep:type>
            </dep:dependency>
        </dep:dependencies>
    </dep:environment>
    <resourceadapter>
        <outbound-resourceadapter>
            <connection-definition>
                <connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
                <connectiondefinition-instance>
                    <name>LiferayPool</name>
                    <config-property-setting name="Password">password</config-property-setting>
                    <config-property-setting name="Driver">com.mysql.jdbc.Driver</config-property-setting>
                    <config-property-setting name="UserName">root</config-property-setting>
                    <config-property-setting name="ConnectionURL">jdbc:mysql://localhost:3306/lportal</config-property-setting>
                    <connectionmanager>
                        <local-transaction/>
                        <single-pool>
                            <max-size>10</max-size>
                            <min-size>0</min-size>
                            <match-one/>
                        </single-pool>
                    </connectionmanager>
                </connectiondefinition-instance>
            </connection-definition>
        </outbound-resourceadapter>
    </resourceadapter>
 </connector>

Make sure you update ConnectionURL, UserName and Password to your local values before deploying the plan.

Deploy the connection pool by running the following command from the <geronimo_home>/bin directory:

 deploy --user system --password manager deploy <plans_home>\liferay-pool_mysql.xml ..\repository\tranql\tranql-connector\1.2\tranql-connector-1.2.rar

You should see a confirmation message similar to this one:

 d:\geronimo-1.1.1-Tomcat\bin>deploy --user system --password manager deploy \plans\liferay-pool_mysql.xml ..\repository\tranql\tranql-connector\1.2\tranql-connector-1.2.rar
 Using GERONIMO_BASE:   D:\geronimo-1.1.1-Tomcat
 Using GERONIMO_HOME:   D:\geronimo-1.1.1-Tomcat
 Using GERONIMO_TMPDIR: D:\geronimo-1.1.1-Tomcat\var\temp
 Using JRE_HOME:        C:\Java\jdk1.5.0_06\
 Deployed liferay/liferay-pool/4.2.1/car

Install the server plugin#

With the server plugin requirements fulfilled run the following command to install and start the Liferay portal server.

 deploy --user system --password manager install-plugin <Liferay_plugin_home>/liferay-portal-geronimo-tomcat-4.2.1.car

Installing a downloaded copy of the plugin from the command line may require you to first uninstall the Welcome application in order to avoid a conflict at the web server's context root ('/'). Installing the plugin from a plugin repository employs a feature of the plugin installer that automatically uninstalls the Welcome application for you.

This step may take some time to run, when finished you should see a confirmation message similar to this one:

 D:\geronimo-1.1.1-Tomcat\bin>deploy --user system --password manager install-plugin Liferay\liferay-portal-geronimo-tomcat-4.2.1.car
 Using GERONIMO_BASE:   D:\geronimo-1.1.1-Tomcat
 Using GERONIMO_HOME:   D:\geronimo-1.1.1-Tomcat
 Using GERONIMO_TMPDIR: D:\geronimo-1.1.1-Tomcat\var\temp
 Using JRE_HOME:        C:\Java\jdk1.5.0_06\
 Checking for status every 1000ms:
 null (7%)
 null (8%)
 null (9%)
 null (10%)
 null (11%)
 null (12%)
 null (13%)
 null (14%)
 null (23%)
 null (27%)
 null (31%)
 null (34%)
 null (38%)
 null (42%)
 null (45%)
 null (46%)
 null (50%)
 null (54%)
 Finished installing liferay/liferay-portal-tomcat/4.2.1/car (65365 kB) (100%)
    **** Installation Complete!
    Used existing: geronimo/j2ee-server//car
    Used existing: geronimo/j2ee-security//car
    Used existing: geronimo/rmi-naming//car
    Used existing: geronimo/geronimo-mail//jar
    Used existing:
    org.apache.geronimo.specs/geronimo-javamail_1.3.1_spec//jar
    Used existing: liferay/liferay-pool//car
    Used existing: geronimo/tomcat//car
    Downloaded 65365 kB in 38s (1720 kB/s)
    Now starting liferay/liferay-portal-tomcat/4.2.1/car...
    Started liferay/liferay-portal-tomcat/4.2.1/car @
    http://localhost:8080/

The Geronimo terminal should also display a message similar to this one:

 ############################################################
 # Installed configuration
 #   id = liferay/liferay-portal-tomcat/4.2.1/car
 #   location = D:\geronimo-1.1.1-Tomcat\repository\liferay\liferay-portal-tomcat\4.2.1\liferay-portal-tomcat-4.2.1.car
 ############################################################
 Loading jar:file:/D:/geronimo-1.1.1-Tomcat/repository/liferay/liferay-portal-tomcat/4.2.1/liferay-portal-tomcat-4.2.1.car/WEB-INF/lib/portal-ejb.jar!/system.properties
 Loading jar:file:/D:/geronimo-1.1.1-Tomcat/repository/liferay/liferay-portal-tomcat/4.2.1/liferay-portal-tomcat-4.2.1.car/WEB-INF/lib/portal-ejb.jar!/portal.properties
 Starting Liferay Portal Professional 4.2.1 (Machen / Build 3501 / January 10, 2007)
 15:18:43,937 INFO  [DynamicDialect] Determining dialect for MySQL 5
 15:18:43,953 INFO  [DynamicDialect] Using dialect org.hibernate.dialect.MySQLDialect
 Loading  jar:file:/D:/geronimo-1.1.1-Tomcat/repository/liferay/liferay-portal-tomcat/4.2.1/liferay-portal-tomcat-4.2.1.car/WEB-INF/lib/portal-ejb.jar!/cache-multi-vm.properties
 15:18:53,843 INFO  [HotDeployUtil] Initializing hot deploy manager 27651713
 15:18:53,890 INFO  [ServerDetector] Detected server geronimo
 15:18:54,078 INFO  [AutoDeployDir] Auto deploy scanner started for \home\liferay\deploy

Once started it should have created a \home\liferay\deploy directory on the same drive/file system where Geronimo resides. This directory can be used to deploy portlets and templates from the command line.

You can now access the Liferay portal server by pointing your browser to the following URL:

 http://localhost:8080/

Note that it may take some time the first time you access the server. Refer to the Liferay documentation available at http://www.liferay.com/web/guest/documentation for details on how to configure the server.

Reboot Geronimo and Tomcat bundle#

Once the configuration to use MySQL is complete the reboot will output something similar to the following to the Geronimo command window:

 Geronimo Application Server started                                             
 777: 11:27:38,309 INFO [DirectoryMonitor] At startup, found C:\Programs\Liferay\deploy\liferay-noir-theme.war with deploy time 1200042673578 and file time 1200042472133
 778: 11:27:51,647 INFO [Hot Deployer] Deploying liferay-portal.war
 779: 11:29:29,271 WARN [StartupAction] Could not look up : env/mail/MailSession
 780: 11:29:32,641 INFO [DynamicDialect] Determining dialect for MySQL 5
 781: 11:29:32,657 INFO [DynamicDialect] Using dialect org.hibernate.dialect.MySQLDialect
 782: 11:29:43,109 INFO [StartupAction] Running verification com.liferay.portal.verify.VerifyProcessSuite
 783: 11:29:43,109 INFO [VerifyProcessSuite] Verifying integrity
 784: 11:29:43,124 INFO [VerifyBlogs] Verifying integrity
 785: 11:29:43,218 INFO [CustomSQLUtil] Database name MySQL
 786: 11:29:43,218 INFO [CustomSQLUtil] Detected MySQL with database name MySQL
 787: 11:29:43,265 INFO [PortalUtil] Portal lib url file:/C:/Programs/Liferay/repository/liferay/liferay-portal-tomcat/4.3.6/liferay-portal-tomcat-4.3.6.car/WEB-INF/lib/portal-impl.jar!/com/liferay/portal/util/PortalUtil.class
 788: 11:29:43,265 INFO [PortalUtil] Portal lib directory /C:/Programs/Liferay/repository/liferay/liferay-portal-tomcat/4.3.6/liferay-portal-tomcat-4.3.6.car/WEB-INF/lib/
 789: 11:29:43,670 INFO [VerifyBookmarks] Verifying integrity
 790: 11:29:43,748 INFO [VerifyDocumentLibrary] Verifying integrity
 791: 11:29:43,873 INFO [VerifyImageGallery] Verifying integrity
 792: 11:29:45,729 INFO [VerifyJournal] Verifying integrity
 793: 11:30:03,638 INFO [StartupAction] Finished verification com.liferay.portal.verify.VerifyProcessSuite
 794: 11:30:04,200 INFO [PluginPackageHotDeployListener] Reading plugin package for the root context
 795: 11:30:05,089 INFO [ServerDetector] Detected server geronimo
 796: 11:30:05,323 INFO [AutoDeployDir] Auto deploy scanner started for C:\Users\Admin\liferay\deploy
 797: 11:30:07,086 INFO [PluginPackageHotDeployListener] Reading plugin package for liferay-noir-theme
 798: 11:30:07,460 INFO [PluginPackageHotDeployListener] Plugin package liferay/liferay-noir-theme/4.3.6.1/war registered successfully
 799: 11:30:07,460 INFO [ThemeHotDeployListener] Registering themes for liferay-noir-theme
 800: 11:30:07,476 INFO [ThemeHotDeployListener] Themes for liferay-noir-theme registered successfully
 801: 11:30:07,757 INFO [Hot Deployer] Deploying tunnel-web.war
 803: 11:33:06,704 INFO [PluginPackageUtil] Reloading repositories

You can delete the Derby lportal database from the Geronimo console:

http://localhost:8080/console/portal/internalDB/internalDB_DBManager

0 Attachments
23261 Views
Average (0 Votes)
The average rating is 0.0 stars out of 5.
Comments
Threaded Replies Author Date
I'm not able to find the .car file for LR 6.0.5... Vijay Srivastava August 9, 2011 5:28 PM

I'm not able to find the .car file for LR 6.0.5 . Can you please advice. Also, is there an EE version available for the same ?
Posted on 8/9/11 5:28 PM.