                  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.3 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 


Start the OC4J server:
-----------------------
cd $J2EE_HOME
java -jar $J2EE_HOME/oc4j.jar

(in standalone OC4J; in iAS, use the standard DCM/EM tools to start
OC4J).


Deploy the mdb application and do the bindWeb:
----------------------------------------------
cd $J2EE_HOME
java -jar admin.jar ormi://${HOST}:${RMI_PORT} admin welcome -deploy -file mdbdemo_ojms.ear
-deploymentName mdbdemo_ojms

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

Please note:
============
1. If you issue the deployment command under $J2EE_HOME or somewhere which is not the
directory that your application ear file located, you would need to give the full path for
the ear file.

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

3. The deployment and bind commands above are for OC4J standalone mode. If you want to run
the demo at iAS mode, please use dcmctl command do the deployment and bind as following:

dcmctl deployApplication -f mdbdemo_ojms.ear -a mdbdemo_ojms -v -d

Please give the path of ear file and issue the command at proper location.


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, the http port is 8888 as
default.

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

