
Example Overview:
-----------------

This example shows several things:
- How to deploy a web application with EJB that is not packaged in a ear
  via the web service.
- How to use Jetty as servlet container instead of Tomcat via the jetty service.
- How to use security both in Tomcat/Jetty to authentificate the user and in JOnAS to authorize
  him to access the EJB methods. This is described in details in the
  "Use Security in JOnAS with TOMCAT" howto of the JOnAS documentation.

The "bean" directory contains an EJB that mimics $JONAS_ROOT/examples/src/sb
with the addition of security access to the bean methods.

Others directories contain a web application.

Compiling this example creates a .war file that represents the web application that
will be used by Tomcat or Jetty to run the servlet.

Prerequisites
-------------
First, you must have installed Tomcat4.1.x or Jetty 4.2.x. 



Compiling and installing this example:
--------------------------------------

If the Ant 1.5 build tool is installed on your machine you can also build this
example by using the build.xml as it is defined in the $JONAS_ROOT/example/README.
 ant install

Running this example:
--------------------
Commands are given for an Unix system. 
(Similar commands can be done on Windows)

1) Choose your servlet container
   - For tomcat : set CATALINA_HOME and CATALINA_BASE as indicated in the Tomcat 4.1.x documentation.
   - For Jetty  : set JETTY_HOME and choose the jetty web container service in jonas.properties

2) Run an EJB Server:
	cd $JONAS_ROOT/examples/websample
	jonas start

3) Run your web browser (e.g., netscape):
	netscape http://<hostname>:<port>/websample
	where <hostname> is the name of your machine (localhost by default)
	and <port> the port number (8080 by default)

Known Issue
-----------
Although this example should run very well with RMI, running it with JEREMIE may lead 
to an error in the servlet:

          Cannot lookup OpHome: java.lang.ClassCastException 

A workaroud is to remove the jar file from webapps/websample/WEB-INF/lib and make it
visible in the CLASSPATH (from within $JONAS_ROOT/ejbjars).
The correct solution is to prefer "ear packaged" applications (See alarm example).
