Default domain configuration in AS7

The default domain.xml and host.xml configuration files are detailed in this section.
<domain xmlns="urn:jboss:domain:1.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="urn:jboss:domain:1.0 jboss_7_0.xsd
                            urn:jboss:domain:arquillian:1.0 jboss-arquillian.xsd
                            urn:jboss:domain:connector:1.0 jboss-connector.xsd
                            urn:jboss:domain:datasources:1.0 jboss-datasources.xsd
                            urn:jboss:domain:ejb3:1.0 jboss-ejb3.xsd
                            urn:jboss:domain:ee:1.0 jboss-ee.xsd
                            urn:jboss:domain:jaxrs:1.0 jboss-jaxrs.xsd
                            urn:jboss:domain:jmx:1.0 jboss-jmx.xsd
                            urn:jboss:domain:jpa:1.0 jboss-jpa.xsd
                            urn:jboss:domain:messaging:1.0 jboss-messaging.xsd
                            urn:jboss:domain:naming:1.0 jboss-naming.xsd
                            urn:jboss:domain:osgi:1.0 jboss-osgi.xsd
                            urn:jboss:domain:remoting:1.0 jboss-remoting.xsd
                            urn:jboss:domain:resourceadapters:1.0 jboss-resource-adapters.xsd
                            urn:jboss:domain:sar:1.0 jboss-sar.xsd
                            urn:jboss:domain:threads:1.0 jboss-threads.xsd
                            urn:jboss:domain:transactions:1.0 jboss-txn.xsd
                            urn:jboss:domain:web:1.0 jboss-web.xsd
                            urn:jboss:domain:security:1.0 jboss-security.xsd
                            urn:jboss:domain:webservices:1.0 jboss-webservices.xsd
                            urn:jboss:domain:weld:1.0 jboss-weld.xsd">

   <extensions>
      <extension module="org.jboss.as.connector"/>
      <extension module="org.jboss.as.jmx"/>
      <extension module="org.jboss.as.jpa"/>
      <extension module="org.jboss.as.logging"/>
      <extension module="org.jboss.as.ee"/>
      <extension module="org.jboss.as.ejb3"/>
      <extension module="org.jboss.as.jaxrs"/>
      <extension module="org.jboss.as.messaging"/>
      <extension module="org.jboss.as.naming"/>
      <extension module="org.jboss.as.osgi"/>
      <extension module="org.jboss.as.remoting"/>
      <extension module="org.jboss.as.sar"/>
      <extension module="org.jboss.as.security"/>
      <extension module="org.jboss.as.threads"/>
      <extension module="org.jboss.as.transactions"/>
      <extension module="org.jboss.as.web"/>
      <extension module="org.jboss.as.weld"/>
      <extension module="org.jboss.as.webservices" />
   </extensions>

   <profiles>

      <profile name="default">

         <subsystem xmlns="urn:jboss:domain:logging:1.0">
            <console-handler name="CONSOLE">
               <level name="INFO"/>
               <formatter>
                  <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
               </formatter>
            </console-handler>

            <periodic-rotating-file-handler name="FILE">
               <level name="INFO"/>
               <formatter>
                  <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
               </formatter>
               <file relative-to="jboss.server.log.dir" path="server.log"/>
               <suffix value=".yyyy-MM-dd"/>
            </periodic-rotating-file-handler>

            <root-logger>
               <level name="INFO"/>
               <handlers>
                  <handler name="CONSOLE"/>
                  <handler name="FILE"/>
               </handlers>
            </root-logger>
         </subsystem>
         <subsystem xmlns="urn:jboss:domain:threads:1.0">
            <scheduled-thread-pool name="remoting">
               <max-threads count="10" per-cpu="20"/>
               <keepalive-time time="10" unit="seconds"/>
            </scheduled-thread-pool>
            <bounded-queue-thread-pool name="jca-short-running" blocking="true">
               <core-threads count="10" per-cpu="20"/>
               <queue-length count="10" per-cpu="20"/>
               <max-threads count="10" per-cpu="20"/>
               <keepalive-time time="10" unit="seconds"/>
            </bounded-queue-thread-pool>
            <bounded-queue-thread-pool name="jca-long-running" blocking="true">
               <core-threads count="10" per-cpu="20"/>
               <queue-length count="10" per-cpu="20"/>
               <max-threads count="10" per-cpu="20"/>
               <keepalive-time time="10" unit="seconds"/>
            </bounded-queue-thread-pool>
            <bounded-queue-thread-pool name="ejb3-async" blocking="true">
               <core-threads count="10" per-cpu="20"/>
               <queue-length count="10" per-cpu="20"/>
               <max-threads count="10" per-cpu="20"/>
               <keepalive-time time="10" unit="seconds"/>
            </bounded-queue-thread-pool>
         </subsystem>
         <subsystem xmlns="urn:jboss:domain:ee:1.0"/>
         <subsystem xmlns="urn:jboss:domain:ejb3:1.0" />
         <subsystem xmlns="urn:jboss:domain:naming:1.0"/>
         <subsystem xmlns="urn:jboss:domain:security:1.0">
            <security-domains>
               <security-domain name="other">
                  <authentication>
                     <login-module code="UsersRoles" flag="required"/>
                  </authentication>
               </security-domain>
            </security-domains>
         </subsystem>
         <subsystem xmlns="urn:jboss:domain:transactions:1.0">
            <recovery-environment socket-binding="txn-recovery-environment" 
                                  status-socket-binding="txn-status-manager"/>
            <core-environment socket-binding="txn-socket-process-id"/>
         </subsystem>
         <subsystem xmlns="urn:jboss:domain:remoting:1.0" thread-pool="remoting"/>
         <subsystem xmlns="urn:jboss:domain:jmx:1.0">
             <jmx-connector registry-binding="jmx-connector-registry" 
                            server-binding="jmx-connector-server" />
         </subsystem>
         <subsystem xmlns="urn:jboss:domain:sar:1.0"/>
         <subsystem xmlns="urn:jboss:domain:weld:1.0"/>
         <subsystem xmlns="urn:jboss:domain:connector:1.0">
            <archive-validation enabled="true"/>
            <bean-validation enabled="true"/>
            <default-workmanager short-running-thread-pool="jca-short-running" 
                                 long-running-thread-pool="jca-long-running" />
         </subsystem>
         <subsystem xmlns="urn:jboss:domain:datasources:1.0">
            <datasources>
               <datasource jndi-name="java:/H2DS" enabled="true" 
                           use-java-context="true" pool-name="H2DS">
                  <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>
                  <driver-class>org.h2.Driver</driver-class>
                  <driver>org.h2.Driver#1.2</driver>
                  <pool></pool>
                  <security>
                     <user-name>sa</user-name>
                     <password>sa</password>
                  </security>
               </datasource>
            </datasources>
            <drivers>
               <driver module="com.h2database.h2"/>
            </drivers>
         </subsystem>
         <subsystem xmlns="urn:jboss:domain:resourceadapters:1.0" />
         <subsystem xmlns="urn:jboss:domain:osgi:1.0" activation="lazy">
            <configuration pid="org.apache.felix.webconsole.internal.servlet.OsgiManager">
               <property name="manager.root">jboss-osgi</property>
            </configuration>
            <properties>
               <property name="org.jboss.osgi.system.modules">
                  org.apache.log4j,
                  org.jboss.arquillian.api,
                  org.jboss.arquillian.junit,
                  org.jboss.arquillian.protocol.osgi,
                  org.jboss.arquillian.spi,
                  org.jboss.as.osgi,
                  org.jboss.shrinkwrap.api,
                  javax.inject.api,
                  org.junit
               </property>
               <property name="org.osgi.framework.system.packages.extra">
                  javax.transaction;version=1.1,
                  org.apache.log4j;version=1.2,
                  org.jboss.as.osgi.service;version=7.0,
                  org.jboss.logging;version=3.0,
                  org.jboss.osgi.deployment.deployer;version=1.0,
                  org.jboss.osgi.deployment.interceptor;version=1.0,
                  org.jboss.osgi.spi;version=1.0,
                  org.jboss.osgi.spi.capability;version=1.0,
                  org.jboss.osgi.spi.util;version=1.0,
                  org.jboss.osgi.testing;version=1.0,
                  org.jboss.osgi.vfs;version=1.0,

                  org.jboss.arquillian.api, 
                  org.jboss.arquillian.junit,   
                  org.jboss.arquillian.osgi,
                  org.jboss.shrinkwrap.api, 
                  org.jboss.shrinkwrap.api.asset, 
                  org.jboss.shrinkwrap.api.spec,
                  org.jboss.shrinkwrap.impl.base,
                  org.junit, org.junit.runner, javax.inject
               </property>
            </properties>
            <modules>
               <module identifier="org.osgi.compendium"/>
               <module identifier="org.apache.aries.util"/>
               <module identifier="org.jboss.as.osgi.configadmin" start="true"/>
               <module identifier="org.apache.felix.configadmin" start="true"/>
               <module identifier="org.jboss.osgi.common" start="true"/>
               <module identifier="org.apache.aries.jmx" start="true"/>
               <module identifier="org.jboss.osgi.jmx" start="true"/>
            </modules>
         </subsystem>
         <subsystem xmlns="urn:jboss:domain:messaging:1.0">
            <!--
               Default journal file size is 10Mb,
               reduced here to 100k for faster first boot
            -->
            <journal-file-size>102400</journal-file-size>
            <journal-min-files>2</journal-min-files>
            <journal-type>NIO</journal-type>
            <!-- disable messaging persistence -->
            <persistence-enabled>false</persistence-enabled>

            <connectors>
               <in-vm-connector name="in-vm" server-id="0" />
               <netty-connector name="netty" socket-binding="messaging" />
               <netty-connector name="netty-throughput" 
                                socket-binding="messaging-throughput">
                  <param key="batch-delay" value="50"/>
               </netty-connector>
            </connectors>

            <acceptors>
               <in-vm-acceptor name="in-vm" server-id="0" />
               <netty-acceptor name="netty" socket-binding="messaging" />
               <netty-acceptor name="netty-throughput" 
                               socket-binding="messaging-throughput">
                  <param key="batch-delay" value="50"/>
                  <param key="direct-deliver" value="false"/>
               </netty-acceptor>
            </acceptors>

            <security-settings>
               <security-setting match="#">
                  <permission type="createNonDurableQueue" roles="guest"/>
                  <permission type="deleteNonDurableQueue" roles="guest"/>
                  <permission type="consume" roles="guest"/>
                  <permission type="send" roles="guest"/>
               </security-setting>
            </security-settings>

            <address-settings>
               <!--default for catch all-->
               <address-setting match="#">
                  <dead-letter-address>jms.queue.DLQ</dead-letter-address>
                  <expiry-address>jms.queue.ExpiryQueue</expiry-address>
                  <redelivery-delay>0</redelivery-delay>
                  <max-size-bytes>10485760</max-size-bytes>
                  <message-counter-history-day-limit>10</message-counter-history-day-limit>
                  <address-full-policy>BLOCK</address-full-policy>
               </address-setting>
            </address-settings>
         </subsystem>
         <subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/>
         <subsystem xmlns="urn:jboss:domain:messaging:jms:1.0">
            <connection-factory name="InVmConnectionFactory">
               <connectors>
                  <connector-ref connector-name="in-vm" backup-connector-name="netty"/>
               </connectors>
              <entries>
                  <entry name="java:/ConnectionFactory" />
              </entries>
            </connection-factory>
            <connection-factory name="RemoteConnectionFactory">
              <connectors>
                  <connector-ref connector-name="netty" backup-connector-name="in-vm"/>
              </connectors>
              <entries>
                  <entry name="RemoteConnectionFactory" />
              </entries>
            </connection-factory>
            <queue name="testQueue">
               <entry name="queue/test" />
            </queue>
            <topic name="testTopic">
               <entry name="topic/test" />
            </topic>
         </subsystem>
         <subsystem xmlns="urn:jboss:domain:web:1.0">
            <connector name="http" scheme="http" protocol="HTTP/1.1" 
                       socket-binding="http"/>
            <virtual-server name="localhost">
              <alias name="example.com" />
            </virtual-server>
          </subsystem>
         <subsystem xmlns="urn:jboss:domain:webservices:1.0">
            <configuration>
             <webServiceHost>localhost</webServiceHost>
             <modifySOAPAddress>true</modifySOAPAddress>
             <!-- <webServiceSecurePort>8443</webServiceSecurePort>
               <webServicePort>8080</webServicePort> -->
           </configuration>
        </subsystem>
      </profile>
   </profiles>

   <!--
       Named interfaces that can be referenced elsewhere. Different
       mechanisms for associating an IP address with the interface
       are shown.
   -->
   <interfaces>
      <interface name="loopback">
         <inet-address value="127.0.0.1"/>
      </interface>
      <interface name="external">
         <any-ipv4-address/>
      </interface>
   </interfaces>

   <socket-binding-groups>
       <socket-binding-group name="standard-sockets" default-interface="external">
         <include socket-binding-group="messaging-sockets"/>
         <socket-binding name="jmx-connector-registry" port="1090"/>
         <socket-binding name="jmx-connector-server" port="1091"/>
         <socket-binding name="jndi" port="1099"/>
         <socket-binding name="http" port="8080"/>
         <socket-binding name="https" port="8447"/>
         <socket-binding name="osgi-http" port="8090"/>
         <socket-binding name="remoting" port="4447"/>
         <socket-binding name="txn-recovery-environment" port="4712"/>
         <socket-binding name="txn-status-manager" port="4713"/>
         <socket-binding name="txn-socket-process-id" interface="loopback" port="4714"/>
       </socket-binding-group>
       <socket-binding-group name="messaging-sockets" default-interface="external">
         <socket-binding name="messaging" port="5445" />
         <socket-binding name="messaging-throughput" port="5455"/>
       </socket-binding-group>
   </socket-binding-groups>

   <server-groups>
      <server-group name="main-server-group" profile="default">
         <socket-binding-group ref="standard-sockets"/>
         <jvm name="default">
            <heap size="64m" max-size="512m"/>
         </jvm>
      </server-group>

      <server-group name="other-server-group" profile="default">
         <socket-binding-group ref="standard-sockets"/>
         <jvm name="default">
            <heap size="64m" max-size="512m"/>
         </jvm>
      </server-group>
   </server-groups>

</domain>
Figure 15. domain.xml configuration file

<host xmlns="urn:jboss:domain:1.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="urn:jboss:domain:1.0 jboss_7_0.xsd"
     name="local">

   <management-interfaces>
      <native-interface interface="public" port="9999"/>
      <http-interface interface="public" port="9990"/>
   </management-interfaces>
   

   <domain-controller>
      <local/>
      <!-- Remote domain controller configuration with a host and port -->
      <!-- <remote host="192.168.100.1" port="9999"/> -->
   </domain-controller>

   <interfaces>
      <interface name="loopback">
         <inet-address value="127.0.0.1"/>
      </interface>
      <interface name="public">
         <any-ipv4-address />
      </interface>
   </interfaces>
 
 	<jvms>
 	   <jvm name="default">
        <heap size="64m" max-size="128m"/>
      </jvm>
 	</jvms>
 
   <servers>
      <server name="server-one" group="main-server-group">
         <!-- server-one inherits the default socket-group declared in the server-group -->
         <jvm name="default" /> 
      </server>
      <server name="server-two" group="main-server-group" auto-start="true">
         <!-- server-two avoids port conflicts by incrementing the ports in 
             the default socket-group declared in the server-group -->
         <socket-binding-group ref="standard-sockets" port-offset="150"/>
         <jvm name="default">
            <heap size="64m" max-size="256m"/>
         </jvm>
      </server>
      <server name="server-three" group="other-server-group" auto-start="false">
         <!-- server-three avoids port conflicts by incrementing the ports in
             the default socket-group declared in the server-group --> 
         <socket-binding-group ref="standard-sockets" port-offset="250"/>
      </server>
   </servers>
</host>
Figure 16. host.xml configuration file