Installing Liferay on JBoss 5.1
Note: Java 7 deprecated some classes used by JBoss 5.1. Use Java 5 or Java 6 to run JBoss 5.1.Liferay Home is one folder above JBoss’s install location.
- Download and install JBoss EAP 5.1.x into your preferred directory. This directory is referred to as
$JBOSS_HOME
throughout this section. - Download the latest version of the Liferay Portal
.war
file. - Download Liferay’s Portal Dependencies.
Configuring Dependencies
First we’ll take care of dependencies and potential conflicts.- Unzip Liferay’s dependencies to
$JBOSS_HOME/server/default/lib
. - Download your database driver
.jar
file and put it into the folder as well. For demonstration purposes, we’ll download the MySQL Connector/J driver from http://dev.mysql.com/downloads/connector/j/ and put its.jar
file into the$JBOSS_HOME/server/default/lib
folder.
- Next we’ll delete JBoss’s Hibernate Validator and HSQL JARs to
prevent conflicts with Liferay’s JARs. Remove the following files from
$JBOSS_HOME/common/lib
:
hibernate-validator.jar hsqldb.jar hsqldb-plugin.jar
- Open
$JBOSS_HOME/server/default/conf/login-config.xml
in a text editor. - Comment out the blocks with the name
HsqlDBRealm
andJmsXARealm
around lines 41-64.
- Remove the following files from
$JBOSS_HOME/../server/default/deploy
:
/messaging ejb2-container-jboss-beans.xml ejb2-timer-service.xml ejb3-connections-jboss-beans.xml ejb3-container-jboss-beans.xml ejb3-interceptors-aop.xml ejb3-timerservice-jboss-beans.xml hsqldb-ds.xml jms-ra.rar mail-ra.rar mail-service.xml profile-service-secured.jar uuid-key-generator.sar - Delete the following in
$JBOSS_HOME/../server/default/deployers
:
jboss-ejb3-endpoint-deployer.jar messaging-definitions-jboss-beans.xml
Deploying Liferay
Now that we’ve added all of the necessary dependencies and removed unnecessary files, it’s time to deploy Liferay.- Navigate to
$JBOSS_HOME/../server/default/deploy/ROOT.war
and delete all the content of the folder. - Extract the contents of the Liferay WAR file into this folder.
- Create a file named
jboss-classloading.xml
in the$JBOSS_HOME/../server/default/ROOT.war/WEB-INF
directory and add the following contents to it:
jboss-classloading.xml
file to the WEB-INF
folder of each Liferay plugin; see the Deploying plugins section below.- Create a
portal-ext.properties
file in$LIFERAY_HOME
(one level above$JBOSS_HOME
) and add the following properties:
hibernate.validator.apply_to_ddl=false hibernate.validator.autoregister_listeners=false - Delete the following files from the
$JBOSS_HOME/ROOT.war/WEB-INF/lib
:
jaxrpc.jar stax.jar xercesImpl.jar xml-apis.jar - Add the following lines to your
portal-ext.properties
file:
NOTE: The autodeploy folder must be set with the full name of the folder; you can’t use any variables to define the location.
auto.deploy.jboss.dest.dir=${jboss.home.dir}/server/default/deploy auto.deploy.deploy.dir=C:/JBoss-<version>/deploy
- Start the JBoss Application Server.
Deploying plugins
Add ajboss-classloading.xml
to the WEB-INF
folder of each plugin, with the following content:<classloading xmlns="urn:jboss:classloading:1.0"
domain="PLUGINNAME-portlet"
parent-domain="LiferayDomain"
parent-first="false"
top-level-classloader="false"
export-all="NON_EMPTY"
import-all="false">
</classloading>
The LiferayDomain
referenced in the above configuration is the domain we defined above during step 3 of the Deploying Liferay
section. Configuring plugins to use the Liferay domain ensures that if
JBoss and Liferay have different versions of a JAR file, the plugin will
use Liferay’s version. Without this configuration, Liferay plugins
might end up using the wrong versions of JAR files. You can make this
configuration either before or after the plugin WAR has been deployed,
as long as JBoss is not running. Of course, it’s best to make this
configuration before deployment. Otherwise, if there’s a JAR conflict,
you’ll have to shut down your server, configure the plugin to use the
Liferay domain, and restart the server.To set up a hot deploy folder and have plugins automatically copied to the right place, add the following lines to your
portal-ext.properties
file:auto.deploy.jboss.dest.dir=${jboss.home.dir}/server/default/deploy
auto.deploy.deploy.dir=G:/jboss-eap-5.1/deploy
The first line is the value for the default server; if
you’ve installed Liferay in something other than the default, change it
accordingly. The path in the second line should point to the deploy
folder configured for JBoss. Liferay also runs on JBoss 7. Let’s see how we’d get it installed on that version of JBoss.
Comments
Post a Comment