Hobione's Weblog

Living & Breathing in Web 2.0 Era

Liferay Portal on Glassfish App Server

I was able to install Liferay Portal 5.1.1 on Sun Java Application Server 9 UR 2 aka Glassfish. Here are some steps I have followed.
1. Downloaded these following files from SourceFge.net

  1. liferay-portal-dependencies-5.1.1.zip
  2. liferay-portal-ext-5.1.1.zip
  3. liferay-portal-5.1.1.war

2. Copy all five jar files from liferay-portal-dependencies-5.1.1 into $GLASSFISH_HOME/domains/domain1/lib
3. Copy xercesImpl.jar and JDBC driver into the same place. You can find xercesImpl.jar under liferay-portal-ext-5.1.1
4. $GLASSFISH_HOME/domains/domain1/lib  should looks like this.

9jarfiles

5. Login to your Glassfish app server Admin GUI and do as follows:

  1. Setup JDBC connection pool
  2. Liferay Pool Setup

  3. Setup JNDI lookup
  4. LiferayJNDILookup

  5. Setup Java Mail
  6. LiferayJavaMailSetup

  7. Log out of the Administration Console and stop Glassfish.

6. You can deploy Liferay in two ways.

  1. Copy liferay-portal-5.1.1.war to glassfish-v2ur2\domains\domain1\autodeploy
  2. Use Glassfish Admin GUI to deploy

Dilemma: I needed to run the Portal server under a different context other than root, so URL would look like this. http://atowxx.abc.gov/idmsportal

Solution: I had to unwar the liferay-portal-5.1.1.war file by using this command. jar -xvf liferay-portal-5.1.1.war

Here is the directory structure should look like after unwar the file.
unwar
I have added a new properties file under \WEB-INF\classes an named it portal-ext.properties
Open up the portal-ext.properties with Textpad and add this line at the very top.
portal.ctx=/idmsportal
Now, rewar everything by using this command,  jar cvf liferay-portal-5.1.1.war .

Caution: Make sure there is no sub directory has been created (match with above directory structure).  The best way to test this to use jar tvf liferay-portal-5.1.1.war to see the list view or unwar your newly created war file to see directory structor. If you create the war file successfully with original directory structor, it’s ready to deploy. You can do auto deploy or using Admin GUI to deploy the Portal on Glassfish.

References:
1. Rich Sezov’s blog (A must read)
2. Sun Joins Liferay Open Source Community

December 8, 2008 - Posted by | GlassFish, Portal-Liferay | ,

1 Comment »

  1. Hi Obi-Wan

    Thanks for the great post. :o)
    I worked with these instructions and managed to get the latest version of Liferay up and running on Glassfish 2.

    -Garry

    http://www.greatwhiteit.com/web/guest/home/-/blogs/how-to-install-liferay-on-the-glassfish-applicaiton-server-over-ssh

    Comment by Garry Donnelly | April 17, 2010 | Reply


Leave a comment