

New World Cruises Example Overview:
==================================

The New World Cruises example is the well-known application available on the 
java.sun.com site illustrating Blueprints guidelines and patterns about
Enterprise applications and Web services.

It consists of :

- 3 EJB :
	* EJB Cruises : enable to obtain  diferents informations of Cruises 
                        like depart date
        * EJB CruisesManager : enable to manage an Cruise
        * EJB Passenger : enable to manager passenger

- 2 web services
	* The first is accessible on SUN server
        * The second is accessible on JOnAS server


This $JONAS_ROOT/examples/NewWorldCruises example is the New World Cruises
customized for running on the JOnAS server.



Directory structure:
====================

./jo:
	This directory contains the New World example files specific to JOnAS,
	(i.e. essentially ant build files and XML deployment descriptor files
	specific to JOnAS). It also contains some New World Cruises sources 
        that was modified :
            -to be conform on EJB 2.0 specification (add RemoveException for 
             method ejbRemove and CreateException for method ejbCreate).
            -to modify the GlueBean class to use the remote interface and 
             not the local interface because the bean define only an remote
             interface.
            -to modify jsp for access to sun webservice because the generated 
             classes by Axis not have the same name that SUN generate files.
            -to add jsp for access to JOnAS webservice.

./Cruises
	This directory must contain the original New World Cruises example.
	It's up to you to create it by downloading the New World Cruises.

./jonas-newworld:
	This directory will contain the New World example customized for 
        running on the JOnAS server.
	It is automatically created from the two previous directories via a
	build command (see after).



Downloading New World Cruises:
==============================

- Download New World Cruises example from
   http://developer.sun.com/sw/building/tech_articles/jaxrpc/index.html

- Unzip the 'Cruises.zip' file under $JONAS_ROOT/examples/NewWorldCruises.

You must download the file AirService.wsdl. This file correspond to the web 
service description and it used to generated class to access to sun web 
service. Put this file under $JONAS_ROOT/examples/NewWorldCruises

After the unzip step, the '$JONAS_ROOT/examples/NewWorldCruises/Cruises' 
directory will be created.
Also a file Part2_site.zip is generate but this zip file is not used because 
it contains also the jsp for accessing to the sun web service 
(and this access is not equal because it depends to axis generated files).


Configuration:
=================
You must modify the build.properties under the directory NewWorldCruises. 
Indeed, you must modify the url corresponding to the JOnAS webservice 
( url.ws.jonas).
Modify also the tag mapper.names and use the good adapter for your database
Configure correctly your $JONAS_BASE/conf/carol.properties.
Configure correctly your $JONAS_BASE/conf/<db>.properties.
Configure correctly your $JONAS_BASE/conf/jonas.properties.
Create your tables using the file Cruises/cruise_init.sql.


Customizing New World Cruises for JOnAS:
========================================

- Under $JONAS_ROOT/examples/NewWorldCruises, do
    $ ant customize4jonas

Then, a 'Cruises' directory will be created, containing the New World Cruises 
example sources customized for running on JOnAS.


Compilation :
=============
- Under $JONAS_ROOT/examples/NewWorldCruises, do
    $ ant install



Running this example:
=====================

1) Run JOnAS server:
====================
1) Start the JOnAS server

   $ jonas start

2) Under $JONAS_ROOT/examples/NewWorldCruises, do
    $ ant deployAll
This command enable to : 
     *Deploy the application Cruise_App2.ear containing the 3 EJB, and a 
      webapp to access to application (http://localhost:<port>/newworld)
     *Deploy the JOnAS webservice under the url specified in build.xml
     *Generate classes by axis to access to the JOnAS webservice by the url of 
      JOnAS webservice
     *Generate classes by axis to access to the SUN webservice by the file 
      AirService.wsdl
     *Compile the generated classes
     *Build the web application to access to the JOnAS web Service
     *Build the web application to access to the SUN web Service
     *Deploy the web application generated 


3) Access to Application by http://localhost:<port>/newworld

4) Access to JOnAS webservice by http://localhost:<port>/AirClientJOnAS

5) Acces to SUN webservice by http://localhost:<port>/AirClientSUN



(The default Tomcat http connector port number is 8080)



Miscellaneous
=============
 Proxy : 

if you use proxy you must export in JAVA_OPTS : 
     " -Dhttp.proxyHost=<proxy> \
       -Dhttp.proxyPort=<proxyport> \
       -Dhttp.proxyUser=<login> \
       -Dhttp.proxyPassword=<password> \
       -Dhttp.nonProxyHosts=<host_server_jonas> \
       -Dhttp.proxySet=true \
"

