Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...


In this chapter, we cover the basics of setting up and deploying an application using Fabric3. Subsequent chapters will cover developing loosely-coupled services, runtime configuration and topics such as integration with Java Persistence Architecture (JPA).
This manual assumes a basic understanding of SCA concepts. Before proceeding, if you have not done so, we recommend familiarizing yourself with SCA. The specifications themselves (downloadable from {+}http://www.oasis-opencsa.org/+) are generally not the most accessible source of introductory information. We recommend instead the paper by David Chappell, "Introducing SCA" ({+}http://www.davidchappell.com/articles/Introducing_SCA.pdf+), which presents a balanced and accurate overview of SCA. Alternatively, Jim Marino and Michael Rowley, Understanding SCA (Addison-Wesley) provides an in-depth treatment including Fabric3.

Anchor
_Toc155752610
_Toc155752610
Choosing a Runtime


Fabric3 is designed to run in a variety of environments and provide application portability between them. This is important for flexibility when deploying into different production environments but also essential for effective iterative development. Fabric3 supports running applications out-of-container, in an integration test environment, or in a managed environment such as a JEE application server with minor configuration changes. This provides an efficient and automated mechanism for conducting local testing, integration testing, and production deployment. The following are brief descriptions of the available Fabric3 runtimes:

...

  • The Ant Runtime: The Ant runtime allows applications to be tested as part of a Ant project build. Similar to the Maven runtime, this distribution provides facilities for writing automated tests and mock services that can used to verify a complete application or individual subsystems in an automated fashion.
  •  


Anchor
_Runtime_Layout
_Runtime_Layout
Anchor
_Toc155752611
_Toc155752611
Runtime Layout


The runtime image is organized as:

...

java -jar server.jar controller 

launches a runtime using the runtimes/controller image

java -jar server.jar vm

launches a runtime using the runtimes/vm image

java -jar server.jar participant

launches a runtime using the runtimes/participant image

java -jar server.jar foo

launches a custom runtime using the runtimes/foo image



Anchor
_Toc155752612
_Toc155752612
The Samples


The samples are intended to demonstrate the capabilities of Fabric3 using the standalone or Tomcat distributions. The samples contain individual applications designed to showcase specific features and are organized as follows:

...


For projects that intend to use Spring, Fabric3 also ships with a set of dedicated Spring samples. These samples are ports of the SCA Java samples described in this chapter, with SCA Java components replaced by Spring beans. Basic layout, configuration and deployment remain the same across both sets of samples.

Anchor
_Toc155752613
_Toc155752613
Prerequisites


The samples may be downloaded from {+}http://www.fabric3.org/downloads+ and require the following software:


Note that it is not necessary to download the Fabric3 runtime distribution in addition to the samples as the sample build process will automatically download a distribution and configure a Fabric3 runtime cluster.

Anchor
_Toc155752614
_Toc155752614
Building and Deploying The Starter Applications


The starter calculator applications are the recommended way to get familiar with Fabric3. To build and deploy the calculator applications, do the following:

...

http://localhost:8181/calculator
and its WSDL from:
http://localhost:8181/calculator?wsdl
The samples also contain a separate client for the web services calculator. The client module is located at /samples/wscalc-client. The WSCalcClient class can be executed using the Java command line or via an IDE.

Anchor
_Toc155752615
_Toc155752615
Building and Deploying BigBank


To build and deploy BigBank, do the following:

...


BigBank includes a web application front-end and loan officer web application. Note both web applications currently do not support Internet Explorer. Please use FireFox, Chrome, or Safari.
Copy bigbank-web-1.7.jar and bigbank-backoffice-1.7.jar to the runtimes/vm/deploy directory.


Anchor
_Toc155752616
_Toc155752616
Deploying BigBank to a Distributed Domain


The samples distribution also contains an automated build process for producing a set of clustered servers. To create the clustered servers, execute the following from the servers/cluster directory:
mvn clean install


The build will create three server images located in the target directory of each module under /servers/cluster: controller, zone1, and zone2.
Follow the steps in the previous section to build the BigBank application. When the build completes, launch the H2 database, controller and zone runtimes:

  1.  
  • Launch the shared H2 database process from cluster/database:

...

java -jar server.jar participant


  1.  
  • From the zone2/target/image/bin directory:

java -jar server.jar participant

After booting, the runtimes will discover each other and form a distributed domain consisting of two cluster zones. Note the runtimes may be on the same machine or different machines.
Copy bigbank-loan-1.7.jar to the controller/target/image/runtimes/controller/deploy directory. The controller will provision the loan service to zone1 and the backend services to zone2.
To run additional zone participants, copy one of the images and follow the instructions above for launching the servers. If more than one server is run on the same machine, you will need to modify the HTTP and HTTPS ports in config/participant/systemConfig.xml.

Anchor
_Toc155752617
_Toc155752617
Getting Help


At some point you may require help with Fabric3. The best place to obtain pointers, advice or assistance troubleshooting a problem is the user mailing list, which can be accessed at {+}http://xircles.codehaus.org/projects/fabric3/lists+. There are several mailing lists for Fabric3. Please post questions to the user list. The developer list is intended for topics related to ongoing Fabric3 development and is not a general forum for questions. However, if you are interested in Fabric3 development, we encourage you to participate in discussions.
Should you encounter a bug, we encourage you to file a report in the online JIRA system at {+}http://jira.codehaus.org/browse/FABRICTHREE+. If possible, please include a detailed description and failing testcase (or other appropriate means) to reproduce the problem. Assisting Fabric3 developers in reproducing the problem generally leads to faster resolution.