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_HOMEthroughout this section.
Download the latest version of the Liferay Portal
Download Liferay’s Portal Dependencies.
Now that you have all of your installation files, you are ready to start installing and configuring Liferay on JBoss.
First we’ll take care of dependencies and potential conflicts.
Unzip Liferay’s dependencies to
Download your database driver
.jarfile 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
.jarfile into the
Next we’ll delete JBoss’s Hibernate Validator and HSQL JARs to prevent conflicts with Liferay’s JARs. Remove the following files from
hibernate-validator.jar hsqldb.jar hsqldb-plugin.jar
Next we need to clean up the entries for the JAR files that we deleted.
$JBOSS_HOME/server/default/conf/login-config.xmlin a text editor.
Comment out the blocks with the name
JmsXARealmaround lines 41-64.
We’ll also delete some other files that can cause conflicts with Liferay when it’s deployed.
Remove the following directories and files from
Delete the following in
Now that we’ve added all of the necessary dependencies and removed unnecessary files, it’s time to deploy Liferay.
$JBOSS_HOME/server/default/deploy/ROOT.warand delete all the content of the folder.
Extract the contents of the Liferay WAR file into this folder.
Create a file named
$JBOSS_HOME/server/default/ROOT.war/WEB-INFdirectory and add the following contents to it:
<classloading xmlns="urn:jboss:classloading:1.0" parent-first="false" domain="LiferayDomain" export-all="NON_EMPTY" import-all="true"> </classloading>
This configuration file defines a domain that does not allow parent classes to load first. Instead, Liferay Portal’s classes are exported. Since JBoss comes with its own Hibernate JARs, the above configuration is needed to tell Liferay to ignore these JARs and to use its own JARs instead. If you omit this configuration, you may encounter a Hibernate exception. It’s also necessary to add a
jboss-classloading.xmlfile to the
WEB-INFfolder of each Liferay plugin; see the Deploying plugins section below.
$LIFERAY_HOME(one level above
$JBOSS_HOME) and add the following properties:
Delete the following files from the
Add the following lines to your
NOTE: The autodeploy folder must be set with the full name of the folder; you can’t use any variables to define the location.
The first line is the value for the default server. The path in the second line should point to the
deployfolder configured for JBoss.
Increase the memory given to the JVM
By deafult JBoss gives 512MB memory to the JVM. With this setting it is most likely that you will face the following error at startup, runtime or shutdown:
java.lang.OutOfMemoryError: GC overhead limit exceeded
To give the JVM more memory, edit
run.confon *nix) and change
Start the JBoss Application Server.
Liferay is now successfully installed on JBoss 5.1.
jboss-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>
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.
You should’ve already set up your hot deploy folder in the previous section. To deploy your plugins, simply copy them into your configured Liferay Home
deploy folder, and they are automatically copied to JBoss’s default deploy folder.
Liferay also runs on JBoss 7. Let’s see how we’d get it installed on that version of JBoss.