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 JeanSebastienDelfino:
http://wiki.apache.org/ws/Tuscany/GetTuscany/Linux

New page:
This document describes the detailed steps to setup your system, download the 
Tuscany source code, build the Tuscany runtime, run two SCA samples, a simple 
J2SE program and a Web application invoking a Hello``World SCA service.

These instructions have been tested on a Red``Hat Linux Enterprise 4 system.

= System requirements =
  * '''Red``Hat Enterprise Linux 4''' - We're working on another page with 
detailed instructions for Windows, will be available soon.
  * '''Java JDK 5.0 update 06''' - Tuscany is written in Java, and has been 
tested with this level of JDK.
  * '''Apache Maven 2.0.4 and Apache Ant 1.6.5''' - We are using Maven 2 to 
build Tuscany, plus a few Ant scripts.
  * '''Subversion 1.3.0''' - The Tuscany source code is stored in a Subversion 
(SVN) repository, you need Subversion to download it.
  * '''Apache Tomcat 5.5.16''' - This is the Web container that we integrate 
with, to allow you to use the SCA programming model in Web applications.

= Creating a tuscany directory =
Open a terminal window, then from the shell prompt create a tuscany directory 
as follows:
{{{
mkdir tuscany
cd tuscany
}}}

We're going to download all the tuscany code and the required dependencies in 
this directory.

= Downloading and installing the Java JDK 5.0 =
Point your Web browser to http://java.sun.com/j2se/1.5.0/download.jsp.

Select "Download JDK 5.0 Update 6".

Accept the License agreement, then select Linux self-extracting file - 
jdk-1_5_0_06-linux-i586.bin.

Download jdk-1_5_0_06-linux-i586.bin to the tuscany directory.

>From the shell prompt do the following:
{{{
chmod +x ./jdk-1_5_0_06-linux-i586.bin
./jdk-1_5_0_06-linux-i586.bin
}}}
This will extract the Java JDK 5.0 to tuscany/jdk1_5_0_06.

Modify your user profile ($HOME/.bashrc if you're using bash) and add the 
following lines:
{{{
JAVA_HOME=$HOME/tuscany/jdk1.5.0_06
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
}}}

= Downloading and installing Apache Maven 2.0.4 =
Point your Web browser to http://maven.apache.org/download.html.

Select "Maven 2.0.4 (tar.gz) - maven-2.0.4-bin.tar.gz".

Download maven-2.0.4-bin.tar.gz to the tuscany directory.

>From the shell prompt do the following:
{{{
        tar xzvf maven-2.0.4-bin.tar.gz
}}}
This will extract Maven 2.0.4 under tuscany/maven-2.0.4.

Modify your user profile and add the following lines:
{{{
MVN_HOME=$HOME/tuscany/maven-2.0.4
export MVN_HOME
PATH=$MVN_HOME/bin:$PATH
}}}

= Downloading and installing Apache Ant 1.6.5 =
Point your Web browser to http://ant.apache.org/bindownload.cgi.

Select ".tar.gz archive: apache-ant-1.6.5-bin.tar.gz".

Download apache-ant-1.6.5-bin.tar.gz to the tuscany directory.

>From the shell prompt do the following:
{{{
tar xzvf apache-ant-1.6.5-bin.tar.gz
}}}
This will extract Ant 1.6.5 under tuscany/apache-ant-1.6.5.

Modify your user profile and add the following lines:
{{{
ANT_HOME=$HOME/tuscany/apache-ant-1.6.5
export ANT_HOME
PATH=$ANT_HOME/bin:$PATH
}}}

= Downloading and installing Subversion 1.3.0 =
Point your Web browser to http://subversion.tigris.org/project_packages.html.

Pick a Subversion RPM package for your system, for example for a Red``Hat 
Enterprise Linux 4 pick 
http://summersoft.fay.ar.us/pub/subversion/latest/rhel-4/bin/subversion-1.3.0-1.rhel4.i386.rpm.

Download subversion-1.3.0-1.rhel4.i386.rpm to the tuscany directory.

>From the shell prompt do the following:
{{{
su
}}}
(you need to be root to install the subversion RPM)
{{{
rpm -iv subversion-1.3.0-1.rhel4.i386.rpm
}}}
This will install Subversion 1.3.0 on your system.

You can now close your terminal window.

= Verifying your setup =
Open a new terminal window, then from the shell prompt do the following:
{{{
java -version
mvn --version
ant -version
svn --version
}}}

You should see the following:

http://people.apache.org/~jsdelfino/wiki/screencaps/linux/verifysetup.jpg

You are now ready to check out the Tuscany source code.

= Checking out the Tuscany source code =

>From the shell prompt, do the following:
{{{
cd tuscany
svn co http://svn.apache.org/repos/asf/incubator/tuscany/java
}}}

This should check out all the source code from the Tuscany SVN repository into 
the tuscany/java directory.

When the check out completes, do the following:
{{{
cd java
ls -1
}}}
You should see the following:

http://people.apache.org/~jsdelfino/wiki/screencaps/linux/verifycheckout.jpg

You are now ready to build Tuscany.

= Building the Tuscany runtime =
>From the shell prompt do the following:
{{{
cd $HOME/tuscany/java
mvn
}}}

This will build Tuscany with Maven. Maven will download all the dependency 
JARs, build all the Tuscany sub-projects and run the unit tests.

When the build completes you should see the following:

http://people.apache.org/~jsdelfino/wiki/screencaps/linux/verifybuild.jpg

= Running the HelloWord sample =
To run the Hello``World sample you need to have the following JARs on your Java 
classpath:
{{{
$HOME/.m2/repository/org/osoa/sca-api/SNAPSHOT/sca-api-SNAPSHOT.jar
$HOME/.m2/repository/org/apache/tuscany/tuscany-common/SNAPSHOT/tuscany-common-SNAPSHOT.jar
$HOME/.m2/repository/org/apache/tuscany/tuscany-core/SNAPSHOT/tuscany-core-SNAPSHOT.jar
$HOME/.m2/repository/org/apache/tuscany/tuscany-model/SNAPSHOT/tuscany-model-SNAPSHOT.jar
$HOME/.m2/repository/axis/axis-wsdl4j/1.2/axis-wsdl4j-1.2.jar
$HOME/.m2/repository/commonj/sdo-api/SNAPSHOT/sdo-api-SNAPSHOT.jar
$HOME/.m2/repository/org/apache/tuscany/tuscany-sdo-impl/SNAPSHOT/tuscany-sdo-impl-SNAPSHOT.jar
$HOME/.m2/repository/org/eclipse/emf/ecore/2.2.0-SNAPSHOT/ecore-2.2.0-SNAPSHOT.jar
$HOME/.m2/repository/org/eclipse/emf/common/2.2.0-SNAPSHOT/common-2.2.0-SNAPSHOT.jar
$HOME/.m2/repository/org/eclipse/emf/ecore-change/2.2.0-SNAPSHOT/ecore-change-2.2.0-SNAPSHOT.jar
$HOME/.m2/repository/stax/stax-api/1.0/stax-api-1.0.jar
$HOME/.m2/repository/woodstox/wstx-asl/2.8.2/wstx-asl-2.8.2.jar
$HOME/.m2/repository/org/apache/tuscany/sca/containers/
$HOME/.m2/repository/org/apache/tuscany/sca/containers/tuscany-container-java/SNAPSHOT/tuscany-container-java-SNAPSHOT.jar
}}}

Instead of copying all these JARs by hand, you can use one of the Tuscany build 
scripts to create a directory with a copy of all the required JARs.

>From the shell prompt, do the following:
{{{
ant -f $HOME/tuscany/java/testing/tomcat/build.xml 
-Dtuscany.acceptance.target.dir=$HOME/tuscany/java/target j2se
}}}
This will copy all the required JARs into directory tuscany/java/target/j2se. 
From the shell prompt do the following:
{{{
ls
}}}
You should see the following:

http://people.apache.org/~jsdelfino/wiki/screencaps/linux/verifyj2se.jpg

You are now ready to run the Tuscany Hello``World sample. Do the following:
{{{
cd samples/helloworld
java -Djava.ext.dirs=$HOME/tuscany/java/target/j2se -classpath 
helloworld/target/helloworld-SNAPSHOT.jar 
org.apache.tuscany.samples.helloworld.HelloWorldClient
}}}

This will run the Hello``World sample application, you should see the following:

http://people.apache.org/~jsdelfino/wiki/screencaps/linux/runhelloworld.jpg

= Downloading and installing Tomcat =
Point your Web browser to 
http://apache.secsup.org/dist/tomcat/tomcat-5/v5.5.16/bin/apache-tomcat-5.5.16.tar.gz.

Download apache-tomcat-5.5.16.tar.gz to the tuscany directory.

To install Tomcat, from the shell prompt do the following:
{{{
cd $HOME/tuscany
tar xzvf apache-tomcat-5.5.16.tar.gz
}}}
This will extract Tomcat to tuscany/apache-tomcat-5.5.16.

>From the shell prompt do the following:
{{{
ant -f java/testing/tomcat/build.xml 
-Dtuscany.acceptance.tc.dir=$HOME/tuscany/apache-tomcat-5.5.16 
tuscany.tomcat.fixup
}}}
This will configure Tomcat to use Tuscany and will install the Tuscany JARs 
under the Tomcat lib directory. You should see the following:

http://people.apache.org/~jsdelfino/wiki/screencaps/linux/tomcatsetup.jpg

You are now ready to start Tomcat and run the Tuscany Hello``World``Web sample.

= Running the HelloWorldWeb sample =

>From the shell prompt, do the following:
{{{
cp java/samples/helloworld/helloworldweb/target/helloworldWeb-SNAPSHOT.war 
apache-tomcat-5.5.16/webapps
}}}
This will install the Hello``World``Web sample Web application.
{{{
apache-tomcat-5.5.16/bin/startup.sh
}}}
This will start Tomcat. You should see the following:

http://people.apache.org/~jsdelfino/wiki/screencaps/linux/starttomcat.jpg

Point your Web browser to http://localhost:8080, you should see the following:

http://people.apache.org/~jsdelfino/wiki/screencaps/linux/tomcathome.jpg

To run the Hello``World``Web sample Web application, point your Web browser to 
http://localhost:8080/helloworldWeb-SNAPSHOT, you should see the following:

http://people.apache.org/~jsdelfino/wiki/screencaps/linux/helloworldweb.jpg

Click the Submit button, this will execute the sample Hello``World SCA service. 
You should see the following:

http://people.apache.org/~jsdelfino/wiki/screencaps/linux/helloworldwebsubmit.jpg

To stop Tomcat, from the shell prompt do the following:
{{{
apache-tomcat-5.5.16/bin/shutdown.sh
}}}
This will stop Tomcat, you should see the following:

http://people.apache.org/~jsdelfino/wiki/screencaps/linux/stoptomcat.jpg

Reply via email to