Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info
titleOfficial documentation available

There is also official documentation available regarding the JBoss application server. Please check the pages

Because I had to install a newer version of JBoss / WildFly recently, I'll describe the setup process I did because it was in the end slightly easier than described in the documents mentioned above. This guide is for the JetBrains IDEA (Ultimate) IDE but you might be able to adjust it also for an Eclipse environment.

This guide was checked with JBoss WildFly version 8.2.1.Final and 10.0.10.Final on with IDEA 15 Utilmate on Mac OS X Yosemite.

 

Configure JAAS

...

Magnolia integrates the Java Authentication and Authorization service. To make this work with JBoss, adjust the configuration as described in the official documentation (JBoss AS 7). For your convenience, below is the final configuration for the Magnolia JAAS part. I have added to urn:jboss:domain:security:1.2

...

Code Block
languagexml
titleJBOSS_HOME/standalone/configuration/standalone.xml
<subsystem xmlns="urn:jboss:domain:security:1.2">
	<security-domains>
    	<security-domain name="other" cache-type="default">
        	<authentication>
            	<login-module code="org.apache.jackrabbit.core.security.SimpleLoginModule" flag="required"/>
                <login-module code="Remoting" flag="optional">
                	<module-option name="password-stacking" value="useFirstPass"/>
                </login-module>
                <login-module code="RealmDirect" flag="required">
                	<module-option name="password-stacking" value="useFirstPass"/>
                </login-module>
            </authentication>
        </security-domain>
        <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="jboss-web-policy" cache-type="default">
        	<authorization>
            	<policy-module code="Delegating" flag="required"/>
            </authorization>
        </security-domain>
        <security-domain name="jboss-ejb-policy" cache-type="default">
        	<authorization>
                <policy-module code="Delegating" flag="required"/>
            </authorization>
        </security-domain>
        <security-domain name="jaspitest" cache-type="default">
        	<authentication-jaspi>
            	<login-module-stack name="dummy">
                	<login-module code="Dummy" flag="optional"/>
                </login-module-stack>
                <auth-module code="Dummy"/>
            </authentication-jaspi>
        </security-domain>
    </security-domains>
</subsystem>

 

...

Create a JBoss deployment descriptor within your webapp project

Again, see also the official documentation.

Code Block
languagexml
titleMAGNOLIA_WEBAPP_DIRECTORY/WEB-INF/jboss-deployment-structure.xml
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
  <deployment>
    <exclude-subsystems>
      <subsystem name="jaxrs"/>
      <subsystem name="webservices"/>
      <subsystem name="weld" />
    </exclude-subsystems>
    <!-- Exclusions allow you to prevent the server from automatically adding some dependencies -->
    <exclusions>
      <module name="org.apache.log4j" />
      <module name="org.slf4j" />
    </exclusions>
  </deployment>
</jboss-deployment-structure>

Optional: Create a specifc epolyment context

Because I want Magnolia to load my specific development profile (see WAR configurations) I configure JBoss to be started under the /dev context path of my local WildFly server.

Code Block
languagexml
titleMAGNOLIA_WEBAPP_DIRECTORY/WEB-INF/jboss-web.xml
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
  <context-root>/dev</context-root>
</jboss-web>