How to check Liferay Portal plugin deployment issues

Overview

A common problem developers and system admins face is tracking down why their Liferay Portal plugins fail to deploy to their Java web server.

There are many reasons why Liferay Portal plugins fail to deploy. Please refer to the checklist below for possible causes and solutions.

Environment

We will assume a simple test environment of Liferay Portal and Apache Tomcat:

  • Web Server Host: Any flavour of Unix, Linux or Windows NT
  • Liferay Portal: Liferay Portal 5.2.x, 6.0.x, 6.1.x
  • Web App Server: Apache Tomcat 6.0.x, 7.0.x

The author's test environments for preparing the checklist were:

  • Amazon EC2/AMI + Liferay Portal 6.1 EE GA2 (6.1.20) + Apache Tomcat 7.0.27
  • Mac OS X (10.8.3) + Liferay Portal 6.1 EE GA2 (6.1.20) + Apache Tomcat 7.0.27

Checklist

Purge Apache Tomcat Temp and Work Folders

Stale Apache temp and work files can cause various issues.

e.g. Unix/Linux/MacOSX

% cd LIFERAY_HOME/tomcat-xxx/
% rm -rf temp
% rm -rf work

NOTE: If you use the "rm" command with the recursive switch as "rm -rf", be very careful to only delete the target folder.

Review Apache Tomcat and Liferay Portal Log Files

  • Are any INFO, WARN or ERROR messages logged in the Liferay or Catalina log files ? There is often a clue in the log entries.

Review Liferay Portal Plugin Config Files

  • Check the Liferay Portal config files (*.xml, *.properties). Are the config files suitable for your target environment (i.e. is it an LP 5.2.x config file when an LP 6.1.x config file is expected) ?
  • Do not use both plugin package XML and plugin package properties file in your plugin package (*.war). Use plugin-package.properties file in favour of plugin-package.xml config file. If you use both, you must keep them in sync. Better to use only properties and allow Liferay Portal to build the XML during plugin auto deployment.

Review Timezones

NOTE: Assuming the local timezone is GMT+8 (Australia/Perth).

  • Is the user.timezone property in your Tomcat environment correct ?
    See TOMCAT_HOME/bin/setenv.sh
    ... -Duser.timezone=GMT ...
  • Is the timezone correct for your host web server ? If the target web server has a local time behind the time stamps for files in your Liferay Portal plugin (eg. my-portal.war, my-theme.war), the plugin may not deploy. Apache Tomcat uses a simple time-based strategy to deploy new web apps. If the WAR files are newer than Tomcat's local time, it may ignore the web app (*.war) files. In this case, it may ignore Liferay Portal plugins.
  • Is the Tomcat user.timezone property (above) the same as the web server host time zones (eg. are they both GMT)

Review File Ownership

  • Ensure the Liferay Portal plugin files (*.war) have the same user and group ownership as the Tomcat process. For example, if the Tomcat process is started by user liferay with group liferay, but the plugins files, such as my-portal.war and my-theme.war, are owned by user tim.telcik and group tim.telcik, Tomcat may not be able to deploy the plugin file(s).