To run the sample application, you must compile the source code; bundle it, along with the required metadata files, into appropriate deployment constructs and then deploy these into the application container. This process is somewhat involved, but fortunately is completely automated by an ant build script.
To proceed, you will need to install ant (http://ant.apache.org/) to take advantage of the supplied build file. Version 1.6.1 or later of ant is recommended for this application. The application may not function correctly with versions prior to 1.5.
This release has been tested against JBoss 5.0.0.CR1.
Deploying into JBoss 5.0.0.CR1.
-
Install JBoss 5.0.
-
Set environment variable JBOSS_HOME
to point to the root directory of your JBoss installation.
-
(Optional**) Build and deploy JBoss JTA or JBoss JTS (execute 'ant jbossjta
' or 'ant jbossjts
' in the JBossTS source tree and follow the deployment instructions in file INSTALL of the resulting JBossTS install tree).
-
(Optional**) Build JBoss XTS (follow the XTS build instructions in file INSTALL of the JBossTS install tree).
-
Deploy the XTS service archive <jbossts 4.4.0 xts>/xts-install/sar/jbossxts.sar
into the JBoss 5.0 server deploy directory. n.b. due to a bug in the JBossWS implementation it is only possible to deploy the XTS service archive after starting JBoss AS.
-
Edit the <jbossts 4.4.0 xts>/xts-install/demo/jboss.properties
file, replacing the JBOSS_HOSTNAME
and JBOSS_PORT
with the bind address and port used by your JBoss server and Jboss Web listener. Replace JBOSS_URLSTUB
with a path used as the location for the demo application web services.
-
Compile the application source under <jbossts 4.4.0 xts>/xts-install/demo
, build the application archive file and deploy it into JBoss deploy directory by typing 'build.sh jboss clean deploy
' on Unix or 'build.bat jboss clean deploy
' on Windows
-
Run the application server by using the run.sh or run.bat command.
-
Invoke the demo client by browsing the URL (e.g.): http://hostname:port/xts-demo/
** the JBoss 5.0 installation may include a pre-built, pre-installed JBossTS build and a pre-built XTS service archive.
n.b. the JaxRPC based version of the demo can be built and deployed by substituting target 'deploy
' in the commands listed above with the alternative target 'deployrpc
'
Using the application
-
When invoked, the client will attempt to begin a transaction, reserve theatre tickets, a restaurant table and a taxi according to the parameters you have selected, then commit the transaction. It will log each step of its activity to the console window. As the transaction proceeds, each of the Web Services will pop up a window of its own in which its state and activity log can be seen. Some events in the service code are also logged to the console.
-
The three server applications support a manual transaction control mode which you can use to simulate transaction failures. Use the Change Mode button on the server GUIs. Notice that the client throws an exception if the transaction is rolled back. [ Note: The manual commit mode overrides the normal availability checks in the services, so overbooking may occur. ]
-
The following pages explain the two transaction models available in the XML Transaction , Atomic Transactions and Business Activities. Reading the following pages will help you understand the events taking place within the sample application.