                  Oracle JMS MDB DEMO 
                  ===================

This is a simple set of demo applications that demonstrate the 
configuration and use of Oralce JMS (OJMS) with MDBs  running 
under OC4J. These work on OC4J versions 9.0.4 and higher.

Also assumes that a properly configured Oracle database is 
available for hosting the OJMS queues.

DATABASE SETUP:
---------------
Connect to database as sys (or equivalent) user and run 
the sql/jmsuser.sql script. This is create the user and queues 
required for the demo.
(e.g.) sqlplus sys/change_on_install @jmsuser.sql

Required environment and demo parameters:
-----------------------------------------
ORACLE_HOME      : where the iAS is installed
J2EE_HOME        : root directory of the OC4J source tree

Make sure that you have "java" and "javac" accessible in your 
PATH (i.e. you have a valid JDK, version 1.3 or greater, 
installed).

Requirements:
--------------

1. The users need to configure a resource provider named "mdbdemo" 
at the $J2EE_HOME/config/application.xml to access OJMS queues.

<resource-provider class="oracle.jms.OjmsContext" name="mdbdemo">
     <description> OJMS/AQ </description>
     <property name="datasource" value="jdbc/OracleDS"></property>
</resource-provider>

NOTE: Do not use a different name since the resource provider 
name is hardcoded in the MDB's deployment descriptors. Use name 
of "mdbdemo" only.

2. Configure the $J2EE_HOME/config/data-source.xml with the 
following entry as referenced above to connect to the database 
and schema used in "database setup".


<data-source
     class="com.evermind.sql.DriverManagerDataSource"
     name="OracleDS"
     location="jdbc/OracleCoreDS"
     xa-location="jdbc/xa/OracleXADS"
     ejb-location="jdbc/OracleDS"
     connection-driver="oracle.jdbc.driver.OracleDriver"
     username="jmsuser"
     password="jmsuser"
     url="jdbc:oracle:thin:@%DB_HOST%:%DB_PORT%:%DB_SID%"
     inactivity-timeout="30"
/>


Demo compilation and build ear file:
------------------------------------
The demo uses Ant for the compilation and build ear file.

1. Clean the environment.
% ant clean 

2. Compile the demo classes and build ear file.
% ant 


Running the demo under iAS
--------------------------

1) Start OC4J
Use the standard DCM/EM tools to start OC4J.

2) Deploy the demo
dcmctl deployApplication -f mdbdemo_ojms.ear -a mdbdemo_ojms 

Note that you may have to give path to the ear file.


Running the demo under OC4J
---------------------------
1) Start OC4J
  cd $J2EE_HOME
  java -jar $J2EE_HOME/oc4j.jar

2) Deploy (and bind) the demo

  cd $J2EE_HOME

  java -jar $J2EE_HOME/admin.jar ormi://${HOST}:${RMI_PORT} admin welcome -deploy -file mdbdemo_ojms.ear -deploymentName mdbdemo_ojms

  java -jar $J2EE_HOME/admin.jar ormi://${HOST}:${RMI_PORT} admin welcome -bindWebApp mdbdemo_ojms mdbdemo-web  http-web-site /mdbojms

Note: As the default, in $J2EE_HOME/config/server.xml, the web-site is 
default-web-site.xml, please change it to be http-web-site.xml if you 
want to use http protocol to access the web application.


Run demo:
----------
From a browser, browse to the web application. with the following 
parameters. Please replace the HOST and PORT below with OC4J's 
hostname and http port number, for OC4J Standalone, the http port 
is 8888 as default.  For iAS, the port is 7777 as default.

http://<HOST>:<PORT>/mdbojms/testrp?testmdb=

