The Tomcat Runtime

Fabric3 includes a distribution that runs within a Tomcat server instance. Once installed, runtime configuration is identical to the Standalone Server. Please refer to the chapter on the Standalone Server for details.

One important thing to note is that SCA archives must be deployed to the /fabric3/deploy directory, and not the Tomcat /webapps directory. Standard web application archives, i.e. those that do not contain SCA code or features, may be deployed to the /webapps directory.

Configuration

Setting the Default HTTP Connector

By default, Fabric3 uses the Tomcat connector configured for the following ports:

  • VM: 8080
  • Controller: 8080
  • Participant: 8181

If the Tomcat host where Fabric3 is installed is configured to use a different HTTP connector, it is necessary to update the Fabric3 systemConfig.xml. The following demonstrates a participant configuration which uses the HTTP connector associated with port 8888:

<config>
   <runtime mode="participant"/>
   <tomcat httpPort="8888"/>
</config>

Setting the Runtime Name

To set the runtime name to start a specific Fabric3 configuration, modify the CATALINA_OPTS settings in the Catalona startup scripts, adding:

CATALINA_OPTS="$CATALINA_OPTS -Dorg.fabric3.name=<name>"

For example, to start the standard controller configuration, do the following:

CATALINA_OPTS="$CATALINA_OPTS -Dorg.fabric3.name=controller"

Enabling and Accessing JMX

Fabric3 integrates directly with the Tomcat JMX provider. To setup JMX on Tomcat, add the following CATALINA_OPTS values to the Catalina startup script (e.g. catalina.sh or catalina.bat):

CATALINA_OPTS="-Dcom.sun.management.jmxremote"
CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote.port=1199"
CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote.ssl=false"
CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"

This will make Fabric3 MBeans avalable at the URL:

service:jmx:rmi:///jndi/rmi://localhost:1199/jmxrmi

Configuring the Service Context Path

The context path for HTTP-based services (e.g. web services) can be configured using the tomcat/service.path attribute:

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="urn:fabric3.org">
   <tomcat service.path="services"/>
</config>

In the above example, web services and other HTTP-based services will be available at http://<server address>:<port>/services/<service name>