Magnolia 5.6 reached end of life on June 25, 2020. This branch is no longer supported, see End-of-life policy.
This page describes how to deploy Magnolia as a WAR file on WildFly, formerly known as JBoss Application Server. The procedures described below have been checked for WildFly 10+. Magnolia 5.6 requires WildFly 10 or better for compatibility. This page was also verified with JBoss EAP 7.
Table of Contents |
---|
Magnolia uses the Java Authentication and Authorization Service (JAAS) to authenticate and authorize users. You have to configure the JAAS login modules for WildFly so that you can log into Magnolia:
$WILDFLY_HOME/standalone/configuration/standalone.xml
.<subsystem xmlns="urn:jboss:domain:security:1.2
>
section:Code Block | ||||
---|---|---|---|---|
| ||||
<subsystem xmlns="urn:jboss:domain:security:1.2"> <security-domains> <security-domain name="magnolia" cache-type="default"> <authentication> <login-module code="info.magnolia.jaas.sp.jcr.JCRAuthenticationModule" flag = "requisite" /> <login-module code="info.magnolia.jaas.sp.jcr.JCRAuthorizationModule" flag = "required" /> </authentication> </security-domain> <security-domain name="Jackrabbit" cache-type="default"> <authentication> <login-module code="org.apache.jackrabbit.core.security.SimpleLoginModule" flag = "required" /> </authentication> </security-domain> <security-domain name="other" cache-type="default"> <authentication> <login-module code="org.apache.jackrabbit.core.security.SimpleLoginModule" flag="required"/> </authentication> </security-domain> </security-domains> </subsystem> |
When using Magnolia's worklow modules you might experience class loading issue related to packages of org.jboss.weld.*
. In this case create or edit jboss-deployment-structure.xml
file in Magnolia's WEB-INF
folder by adding the following code.
Code Block | ||||
---|---|---|---|---|
| ||||
<?xml version="1.0"?> <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2"> <deployment> <exclude-subsystems> <subsystem name="weld" /> </exclude-subsystems> </deployment> </jboss-deployment-structure> |
Magnolia uses the Bouncy Castle cryptography package to decode the license key and to secure the activation process. WildFly ships with a slightly older version of these libraries.
Find the BC module folder in $WILDFLY_HOME/modules/system/layers/base/org/bouncycastle/main
.
JBoss EAP $EAP_HOME/modules/system/layers/base/org/bouncycastle/main
bcprov
PKIX bcpkix
bcpg
bcmail
Edit the module.xml
file in the same folder.
Code Block | ||||
---|---|---|---|---|
| ||||
<?xml version="1.0" encoding="UTF-8"?> <module xmlns="urn:jboss:module:1.1" name="org.bouncycastle"> <resources> <resource-root path="bcprov-jdk15on-1.58.jar"/> <resource-root path="bcpkix-jdk15on-1.58.jar"/> <resource-root path="bcpg-jdk15on-1.58.jar"/> <resource-root path="bcmail-jdk15on-1.58.jar"/> </resources> <dependencies> <module name="javax.api" slot="main" export="true"/> </dependencies> </module> |
Create or edit jboss-deployment-structure.xml
file in Magnolia's WEB-INF
folder by adding the following code.
Code Block | ||||
---|---|---|---|---|
| ||||
<?xml version="1.0"?> <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2"> <deployment> <dependencies> <module name="org.bouncycastle" slot="main" export="true" /> </dependencies> </deployment> </jboss-deployment-structure> |
WildFly Application Server adds its own log4j logging configuration. If you want to use your own log4j logging configuration (or the one provided by Magnolia) in your deployment, exclude the default configuration first.
Create a new file jboss-deployment-structure.xml
under the WEB-INF
folder with this content:
Code Block | ||||
---|---|---|---|---|
| ||||
<jboss-deployment-structure> <deployment> <exclusions> <module name="org.apache.log4j" /> <module name="org.slf4j" /> </exclusions> </deployment> </jboss-deployment-structure> |
During a deployment the Resteasy libraries can cause a class loading issue when the RestClient module is used. You can get rid of the issue by excluding the following subsystems in the <deploymenŧ>
element of the jboss-deployment-structure.xml
file:
Code Block | ||
---|---|---|
| ||
<exclude-subsystems> <subsystem name="jaxrs" /> <subsystem name="resteasy" /> </exclude-subsystems> |
To deploy the downloaded Magnolia WAR file to WildFly:
magnoliaAuthor.war
.magnoliaPublic.war
.$WILDFLY_HOME/standalone/deployments
.The application server will automatically pick up the files and deploy them.
Info | ||
---|---|---|
WildFly unpacks .war files to a
|
To deploy an extracted directory:
/magnoliaAuthor.war
directory./magnoliaPublic.war
directory. $WILDFLY_HOME/standalone/deployments
.magnoliaAuthor.war.dodeploy
and magnoliaPublic.war.dodeploy
in the $WILDFLY_HOME/standalone/deployments
directory.The application server will pick up the extracted directories on startup and will deploy them.
http://localhost:8080/magnoliaAuthor/
. http://localhost:8080/magnoliaPublic/
.Info | |||||||||
---|---|---|---|---|---|---|---|---|---|
It may happen that the Magnolia application is not deployed because of deployment timeout. You can avoid this by setting the
|
Without the WAR file placed under WEB-INF
folder, the context path will be the web application's folder name by default.
jboss-web.xml
file in WEB-INF
folder of your Magnolia instance.Add the following section in the file. Replace YourContextPath
with your actual context path which can be /
for a public instance, for example.
Code Block | ||||
---|---|---|---|---|
| ||||
<jboss-web> <context-root>/YourContextPath</context-root> </jboss-web> |
Restart WildFly. Your webapp should be available at http://localhost:8080/<YourContextPath>
.