Dear Wiki user, You have subscribed to a wiki page or wiki category on "Ws Wiki" for change notification.
The following page has been changed by SimonNash: http://wiki.apache.org/ws/Tuscany/TuscanyJava/SCA_Java/GettingStarted The comment on the change is: Created page New page: Getting Started with Apache Tuscany SCA Java M2 ----------------------------------------------- Downloading the Release Files ----------------------------- The following files are available for download: Implementation source distribution: http://people.apache.org/dist/incubator/tuscany/java/sca/1.0-incubator-M2/tuscany-sca-1.0-incubator-M2-src.tar.gz http://people.apache.org/dist/incubator/tuscany/java/sca/1.0-incubator-M2/tuscany-sca-1.0-incubator-M2-src.zip Specification source distributions: http://people.apache.org/dist/incubator/tuscany/java/sca/1.0-incubator-M2/tuscany-spec-sca-r0.95-incubator-M2-src.tar.gz http://people.apache.org/dist/incubator/tuscany/java/sca/1.0-incubator-M2/tuscany-spec-sca-r0.95-incubator-M2-src.zip http://people.apache.org/dist/incubator/tuscany/java/sca/1.0-incubator-M2/tuscany-spec-commonj-1.1-incubator-M2-src.tar.gz http://people.apache.org/dist/incubator/tuscany/java/sca/1.0-incubator-M2/tuscany-spec-commonj-1.1-incubator-M2-src.zip Binary distribution: http://people.apache.org/dist/incubator/tuscany/java/sca/1.0-incubator-M2/tuscany-sca-1.0-incubator-M2-bin.tar.gz http://people.apache.org/dist/incubator/tuscany/java/sca/1.0-incubator-M2/tuscany-sca-1.0-incubator-M2-bin.zip Samples: http://people.apache.org/dist/incubator/tuscany/java/sca/1.0-incubator-M2/tuscany-sca-1.0-incubator-M2-samples.tar.gz http://people.apache.org/dist/incubator/tuscany/java/sca/1.0-incubator-M2/tuscany-sca-1.0-incubator-M2-samples.zip Javadoc: http://people.apache.org/dist/incubator/tuscany/java/sca/1.0-incubator-M2/tuscany-sca-1.0-incubator-M2-javadoc.zip http://people.apache.org/dist/incubator/tuscany/java/sca/1.0-incubator-M2/tuscany-spec-sca-r0.95-incubator-M2-javadoc.zip http://people.apache.org/dist/incubator/tuscany/java/sca/1.0-incubator-M2/tuscany-spec-commonj-1.1-incubator-M2-javadoc.zip These archives all unpack into the current directory. Building the Source Distribution -------------------------------- To build the Tuscany SCA Java implementation from source: 1. Download the implementation source distribution tuscany-sca-1.0-incubator-M2-src.tar.gz or tuscany-sca-1.0-incubator-M2-src.zip. 2. Create an empty directory and unpack the source distribution into that directory. 3. Follow the instructions in the BUILDING.txt file that was unpacked. As part of the above build process, the SCA and commonj specification files will be downloaded as pre-built binaries from the remote maven repositories into your local maven repository. If you prefer, you can build these specification binaries from source and install them in your local maven repository, as follows: 1. Download the SCA specification source distribution tuscany-spec-sca-r0.95-incubator-M2-src.tar.gz or tuscany-spec-sca-r0.95-incubator-M2-src.zip. 2. Create a new empty directory and unpack the source distribution into that directory. 3. Change directory to the newly created directory and run "mvn install". The SCA specification binary jar will be installed in your local maven repository. 4. Download the commonj specification source distribution tuscany-spec-commonj-1.1-incubator-M2-src.tar.gz or tuscany-spec-commonj-1.1-incubator-M2-src.zip. 5. Create a new empty directory and unpack the source distribution into that directory. 6. Change directory to the newly created directory and run "mvn install". The commonj specification binary jar will be installed in your local maven repository. Installing the Binary Distribution ---------------------------------- If you prefer to run from a pre-built binary, proceed as follows: 1. Download the binary distribution tuscany-sca-1.0-incubator-M2-bin.tar.gz or tuscany-sca-1.0-incubator-M2-bin.zip. 2. Create an empty directory and unpack the binary distribution into that directory. 3. In later sections of this document, we will refer to the directory that was created in step 2 (or built from source following the alternative instructions above) as <sca-home>. Building and Running the Samples -------------------------------- 1. Download the samples distribution tuscany-spec-sca-r0.95-incubator-M2-samples.tar.gz or tuscany-spec-sca-r0.95-incubator-M2-samples.zip. 2. Create a new empty directory and unpack the samples distribution into that directory. 3. Change directory to the newly created directory and run "mvn -N install". This will install the samples parent pom.xml file into your local maven repository. 4. Follow the instructions in the readme.html files for the various samples. Tuscany SCA Java M2 files available from maven ---------------------------------------------- The following Tuscany SCA Java M2 files have been published to the public maven respository http://people.apache.org/repo/m2-incubating-repository/ and will be downloaded automatically by maven as needed. The Tuscany runtime is also able to download required dependencies from the maven repositories as needed. org/apache/tuscany/sca/parent/1.0-incubator-M2/parent-1.0-incubator-M2.pom org/apache/tuscany/sca/kernel/parent/1.0-incubator-M2/parent-1.0-incubator-M2.pom org/apache/tuscany/sca/kernel/tuscany-api/1.0-incubator-M2/tuscany-api-1.0-incubator-M2.jar org/apache/tuscany/sca/kernel/tuscany-host-api/1.0-incubator-M2/tuscany-host-api-1.0-incubator-M2.jar org/apache/tuscany/sca/kernel/tuscany-spi/1.0-incubator-M2/tuscany-spi-1.0-incubator-M2.jar org/apache/tuscany/sca/kernel/core/1.0-incubator-M2/core-1.0-incubator-M2.jar org/apache/tuscany/sca/test/1.0-incubator-M2/test-1.0-incubator-M2.jar org/apache/tuscany/sca/services/parent/1.0-incubator-M2/parent-1.0-incubator-M2.pom org/apache/tuscany/sca/services/idl/parent/1.0-incubator-M2/parent-1.0-incubator-M2.pom org/apache/tuscany/sca/services/idl/wsdl/1.0-incubator-M2/wsdl-1.0-incubator-M2.jar org/apache/tuscany/sca/services/containers/parent/1.0-incubator-M2/parent-1.0-incubator-M2.pom org/apache/tuscany/sca/services/containers/javascript/1.0-incubator-M2/javascript-1.0-incubator-M2.jar org/apache/tuscany/sca/services/containers/ruby/1.0-incubator-M2/ruby-1.0-incubator-M2.jar org/apache/tuscany/sca/runtime/parent/1.0-incubator-M2/parent-1.0-incubator-M2.pom org/apache/tuscany/sca/runtime/webapp/1.0-incubator-M2/webapp-1.0-incubator-M2.jar org/apache/tuscany/sca/services/containers/spring/1.0-incubator-M2/spring-1.0-incubator-M2.jar org/apache/tuscany/sca/services/databinding/parent/1.0-incubator-M2/parent-1.0-incubator-M2.pom org/apache/tuscany/sca/services/databinding/databinding-axiom/1.0-incubator-M2/databinding-axiom-1.0-incubator-M2.jar org/apache/tuscany/sca/services/databinding/databinding-sdo/1.0-incubator-M2/databinding-sdo-1.0-incubator-M2.jar org/apache/tuscany/sca/services/bindings/parent/1.0-incubator-M2/parent-1.0-incubator-M2.pom org/apache/tuscany/sca/services/bindings/axis2/1.0-incubator-M2/axis2-1.0-incubator-M2.jar org/apache/tuscany/sca/services/bindings/rmi/1.0-incubator-M2/rmi-1.0-incubator-M2.jar org/apache/tuscany/sca/services/maven/1.0-incubator-M2/maven-1.0-incubator-M2.jar org/apache/tuscany/sca/runtime/webapp-host/1.0-incubator-M2/webapp-host-1.0-incubator-M2.jar org/apache/tuscany/sca/runtime/standalone/1.0-incubator-M2/standalone-1.0-incubator-M2.jar org/apache/tuscany/sca/runtime/standalone-host/1.0-incubator-M2/standalone-host-1.0-incubator-M2.jar org/apache/tuscany/sca/commands/parent/1.0-incubator-M2/parent-1.0-incubator-M2.pom org/apache/tuscany/sca/commands/launcher/1.0-incubator-M2/launcher-1.0-incubator-M2.jar org/apache/tuscany/sca/sca-tools/1.0-incubator-M2/sca-tools-1.0-incubator-M2.jar org/apache/tuscany/sca/plugins/parent/1.0-incubator-M2/parent-1.0-incubator-M2.pom org/apache/tuscany/sca/plugins/tuscany-war-plugin/1.0-incubator-M2/tuscany-war-plugin-1.0-incubator-M2.jar org/apache/tuscany/sca/plugins/tuscany-plugin-wsdl2java/1.0-incubator-M2/tuscany-plugin-wsdl2java-1.0-incubator-M2.jar org/apache/tuscany/sca/plugins/tuscany-plugin-java2wsdl/1.0-incubator-M2/tuscany-plugin-java2wsdl-1.0-incubator-M2.jar org/apache/tuscany/sca/distribution/1.0-incubator-M2/distribution-1.0-incubator-M2.pom org/apache/tuscany/sca/distribution/1.0-incubator-M2/distribution-1.0-incubator-M2-bin.zip org/apache/tuscany/sca/distribution/1.0-incubator-M2/distribution-1.0-incubator-M2-bin.tar.gz org/apache/tuscany/sca/samples/parent/1.0-incubator-M2/parent-1.0-incubator-M2.pom org/osoa/sca-api-r0.95/1.0-incubator-M2/sca-api-r0.95-1.0-incubator-M2.jar org/apache/tuscany/commonj-api_r1.1/1.0-incubator-M2/commonj-api_r1.1-1.0-incubator-M2.jar Packaging a Standalone Tuscany Application ------------------------------------------ To package a Tuscany application for running in the standalone environment (i.e., not within a web application), the application must be packaged as a jar file with the following contents: META-INF/MANIFEST.MF META-INF/sca/default.scdl application executable code and resources In the following instructions, we will refer to this application jar file as <executable-jar>. The MANIFEST.MF file must contain the following line: Main-Class: <packagename.classname> This is the name of the main class to be run by the Tuscany standalone launcher. The default.scdl file defines the SCA components whose implementations are in the jar file. See the SCA documentation and the Tuscany samples for details of how to write an SCDL file. Running a Standalone Tuscany Application ---------------------------------------- To run a Tuscany application in the standalone environment, issue the following command: java -jar <sca-home>/bin/launcher.jar <executable-jar> The standalone launcher initializes the Tuscany runtime, deploys any installed extensions (see below), creates components defined by the default.scdl file, and calls the main class of the application jar file <executable-jar>. Adding Extensions to the Standalone Environment ----------------------------------------------- To add extensions to the standalone environment, you need to copy the required extension jars into the directory <sca-home>/extensions The launcher for the standalone environment looks for this directory and deploys all the extension jars that it finds there. Applications may need a combination of extensions, and some extensions may depend on other extensions. For example, the helloworldwsclient sample needs the following extensions to be present in the extensions directory: axis2-1.0-incubator-M2.jar databinding-sdo-1.0-incubator-M2.jar These extensions will load their required dependencies from the maven repository. The required dependencies are: databinding-axiom-1.0-incubator-M2.jar wsdl-1.0-incubator-M2.jar Building a Tuscany Web Application ---------------------------------- To package a Tuscany application for running in a web application container such as Apache Tomcat, the application must be packaged as a war file with some Tuscany-specific contents. If you are buildng a Tuscany war file using maven, Tuscany provides a maven plugin org/apache/tuscany/sca/plugins/tuscany-war-plugin/1.0-incubator-M2/tuscany-war-plugin-1.0-incubator-M2.jar that performs this packaging. It is downloaded automatically from the maven repository when invoked by a pom.xml. For an example of how to create a pom.xml file that uses this plugin, see the pom.xml file for the webapp/calculatorws sample. Within this pom.xml file, you will see the line <loadExtensionDependencies>false</loadExtensionDependencies> This instructs the Tuscany maven war plugin to create a war file that does not include dependent jar files of Tuscany extensions. Instead, these jar files will be loaded on demand by the Tuscany runtime. If the value of this element is set to true, then the Tuscany maven war plugin will bundle all required dependent jar files within the war file. If you are not using maven to build a Tuscany war file, then you will need to ensure that the following files are included in the war file: WEB-INF/default.scdl see description above WEB-INF/web.xml see below WEB-INF/classes application executable code and resources WEB-INF/lib Tuscany runtime jars from <sca-home>/lib, plus webapp-1.0-incubator-M2.jar (available from maven repository) WEB-INF/tuscany/boot Tuscany runtime jars from <sca-home>/boot, plus webapp-host-1.0-incubator-M2.jar (available from maven repository) WEB-INF/tuscany/extensions required Tuscany extensions WEB-INF/tuscany/repository/dependency.metadata see below The <web-app>...</webapp> section of the WEB-INF/web.xml file must contain the following code: <listener> <listener-class>org.apache.tuscany.runtime.webapp.TuscanyContextListener</listener-class> </listener> <servlet> <servlet-name>TuscanyServlet</servlet-name> <display-name>Tuscany Servlet</display-name> <servlet-class>org.apache.tuscany.runtime.webapp.TuscanyServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>TuscanyServlet</servlet-name> <url-pattern>/services/*</url-pattern> </servlet-mapping> For runtime loading of dependent jars (see the description of the <loadExtensionDependencies> element above), the WEB-INF/tuscany/repository/dependency.metadata file must contain the following code: <?xml version="1.0" encoding="UTF-8"?> <java version="1.5.0_06" class="java.beans.XMLDecoder"> <object class="java.util.HashMap"/> </java> If these dependent jars are packaged within the web application's WEB-INF/tuscany/repository/ directory, please refer to the output of the Tuscany war plugin (with <loadExtensionDependencies> set to true) to see what code needs to be included within the WEB-INF/tuscany/repository/dependency.metadata file. For Further Information ----------------------- If you have any questions about installing, building, or running Tuscany SCA Java M2 that are not answered here, please post them to either the [email protected] list (for end-user questions) or the [email protected] list (for developer questions). The Apache Tuscany team --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
