Tuscany Webapp Sample

Overview

This sample illustrates how to use Apache Tuscany to run a SCA composite inside a web application. It describes how to run it on Apache Tomcat but the application should be portable to other containers such as Jetty or commmercial servers.

Location

This sample is located in the  samples\webapp\webapp directory.  All the following commands should be issued while working in the sample directory. 

Prerequisites

Obtain the following prerequisites and install according to their documentation.

Building

To build the sample issue :

mvn

This should result in the creation of the war file target\sample-webapp.war

Setup

If you have enabled remote deployment in Tomcat by adding the line:

<user username="admin" password="" roles="manager"/>

into <tomcat dir>\conf\tomcat-users.xml you can deploy the WARs to Tomcat using the tomcat-maven-plugin:

mvn tomcat:deploy

Alternatively you can copy the WAR files to Tomcat's webapps directory. Copy target\sample-webapp.war <tomcat dir>/webapps/.

Running

Start the tomcat server by issuing the following command ind the <tomcat dir>\bin directory:

startup

Once you've started your web server, open a browser and go to sample-webapp page at  http://localhost:8080/sample-webapp/  and you should see a web page displaying:


Expression Result
2 + 3 5.0
3 - 2 1.0