Issue
- Detailed steps to Install Liferay DXP on Wildfly
Environment
- Liferay DXP 7.2+
- JDK 1.8
Note: For the Wildfly version check for the Liferay compatibility matrix of 7.2 and 7.3
Resolution
Download the below files from the Help Center:
-
DXP WAR file
-
Dependencies ZIP file
-
OSGi Dependencies ZIP file
- Create the folder $WILDFLY_HOME/modules/com/liferay/portal/main and extract the Dependencies ZIP JARs to it.
- Create the file module.xml in the $WILDFLY_HOME/modules/com/liferay/portal/main folder and insert this configuration:
<?xml version="1.0"?>
<module xmlns="urn:jboss:module:1.0" name="com.liferay.portal">
<resources>
<resource-root path="com.liferay.petra.concurrent.jar" />
<resource-root path="com.liferay.petra.executor.jar" />
<resource-root path="com.liferay.petra.function.jar" />
<resource-root path="com.liferay.petra.io.jar" />
<resource-root path="com.liferay.petra.lang.jar" />
<resource-root path="com.liferay.petra.memory.jar" />
<resource-root path="com.liferay.petra.nio.jar" />
<resource-root path="com.liferay.petra.process.jar" />
<resource-root path="com.liferay.petra.reflect.jar" />
<resource-root path="com.liferay.petra.string.jar" />
<resource-root path="com.liferay.registry.api.jar" />
<resource-root path="hsql.jar" />
<resource-root path="portal-kernel.jar" />
<resource-root path="portlet.jar" />
</resources>
<dependencies>
<module name="javax.api" />
<module name="javax.mail.api" />
<module name="javax.servlet.api" />
<module name="javax.servlet.jsp.api" />
<module name="javax.transaction.api" />
</dependencies>
</module>
For each JAR in the Liferay dependencies ZIP, add a resource-root
element with its path
attribute set to the JAR name. For example, add a resource-root
an element like this for the com.liferay.petra.concurrent.jar
file:
<resource-root path="com.liferay.petra.concurrent.jar" />
-
Create an
osgi
folder in your Liferay Home folder. Extract the OSGi Dependencies ZIP file that you downloaded into the[Liferay Home]/osgi
folder. - Navigate to $WILDFLY_HOME/standalone/configuration/standalone.xml and make the following modifications:
1. In the <jsp-config>
tag set the Java VM compatibility for Liferay source and class files. They are compatible with Java 8 by default.
<jsp-config development="true" source-vm="1.8" target-vm="1.8" />
2. Locate the closing </extensions>
tag. Directly beneath that tag, insert the following system properties:
<system-properties>
<property name="org.apache.catalina.connector.URI_ENCODING" value="UTF-8" />
<property name="org.apache.catalina.connector.USE_BODY_ENCODING_FOR_QUERY_STRING" value="true" />
</system-properties>
3. Add the following <filter-spec>
tag within the <console-handler>
tag which is directly below the <level name="INFO"/>
tag:
<filter-spec value="not(any(match("WFLYSRV0059"),match("WFLYEE0007")))" />
4. Add a timeout for the deployment scanner by setting deployment-timeout="600"
as seen in the excerpt below.
<subsystem xmlns="urn:jboss:domain:deployment-scanner:2.0">
<deployment-scanner deployment-timeout="600" path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000" runtime-failure-causes-rollback="${jboss.deployment.scanner.rollback.on.failure:false}"/>
</subsystem>
5. Remove the welcome content code snippets:
<location name="/" handler="welcome-content"/>
and
<handlers>
<file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
</handlers>
6. Navigate to $WILDFLY_HOME/bin/
standalone.conf.bat (for Windows):
Comment out the initial JAVA_OPTS
assignment:
rem set "JAVA_OPTS=-Xms64M -Xmx512M -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=2560m"
Add the following JAVA_OPTS
assignment one line above the :JAVA_OPTS_SET
the line found at end of the file:
set "JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding=UTF-8 -Djava.net.preferIPv
standalone.conf (for Unix):
1. Below the if [ "x$JAVA_OPTS" = "x" ];
the statement, replace this JAVA_OPTS
statement:
JAVA_OPTS="-Xms1303m -Xmx1303m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=2560m -Djava.net.preferIPv4Stack=true"
with this:
JAVA_OPTS="-Djava.net.preferIPv4Stack=true"
2. Add the following statement to the bottom of the file:
JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true -Djboss.as.management.blocking.timeout=480 -Duser.timezone=GMT -Xms2560m -Xmx2560m -XX:MaxMetaspaceSize=512m"
On JDK 11, add this JVM argument to display four-digit years.
-Djava.locale.providers=JRE,COMPAT,CLDR
NOTE:
If using the IBM JDK with the JBoss server, complete these additional steps:
Navigate to the $JBOSS_HOME/modules/com/liferay/portal/main/module.xml
file and insert the following dependency within the <dependencies>
element:
<module name="ibm.jdk" />
7. Navigate to the $JBOSS_HOME/modules/system/layers/base/sun/jdk/main/module.xml
file and insert the following path names inside the <paths>...</paths>
element:
<path name="com/sun/crypto" />
<path name="com/sun/crypto/provider" />
<path name="com/sun/image/codec/jpeg" />
<path name="com/sun/org/apache/xml/internal/resolver" />
<path name="com/sun/org/apache/xml/internal/resolver/tools" />
8. If the folder $WILDFLY_HOME/standalone/deployments/ROOT.war
already exists in the WildFly installation, delete all of its subfolders and files. Otherwise, create a new folder called $WILDFLY_HOME/standalone/deployments/ROOT.war
.
9. Unzip the DXP .war
file into the ROOT.war
folder.
10. To trigger deployment of ROOT.war
, create an empty file named ROOT.war.dodeploy
in the $WILDFLY_HOME/standalone/deployments/
folder. On startup, WildFly detects this file and deploys it as a web application.
11. Start the WildFly application server by navigating to $WILDFLY_HOME/bin
and running standalone.bat
or standalone.sh
12. Place the activation key in the Liferay DXP deploy folder.
Additional Information
- Installing on WildFly
- Download Wildfly based on supported version as per the compatibility matrix
- Download the Liferay DXP WAR, Dependencies zip, OSGi Dependencies of the particular version