First Created: 01-Nov-2004
Last Updated: 16-Jan-2006
Author: Frances Zhao
This demo application showcases OC4J's JCA 1.5 support and Oracle's generic JMS resource adapter (OracleASjms).
The application is a rather simplified inventory control program. It uses a JSP to let users update the inventory with information such as inventory id, order amount, order description, and stores such information on each new update into a JMS queue. In doing so, it uses a JCA 1.5 JMS resource adapter for outbound communication to the JMS provider. Meanwhile, the application includes an MDB that listens to the same JMS queue provided by the JMS provider. The MDB will get triggered when a message is entered into that JMS queue. It checks on each new inventory update, and would send e-mail notification using JavaMail APIs to a contact personnel once the inventory level of a particular item is below a threshold. This part of the application logic makes use of the same JCA 1.5 JMS resource adapter for inbound communication from the JMS provider.
The JMS provider we use is OC4J JMS, and the JCA 1.5 resource adapter we use is OC4J 10.1.3's generic JMS resource adapter (OracleASjms).
This demo requires that the following sofware components are installed and configured correctly:
Please look at the companion article for detailed explanations on this demo application. The Javadoc's of this application are under the directory %HOWTO_HOME%/doc/javadoc/.
The important configuration files are all under %HOWTO_HOME%/etc directory, with the subdirectory OC4J_DP3_REF holding the sample OC4J configuration files like ra.xml, oc4j-ra.xml, etc. that do not need to be changed to build/run this application but are nevertheless relevant.
The following instructions are for running this demonstration on a standalone instance of Oracle Containers for J2EE 10g (10.1.3).
The JMS provider we use is OC4J JMS. Edit %ORACLE_HOME%/j2ee/home/config/application.xml and if commented, uncomment the definition of the resource-provider named oc4jjms.
Edit %ORACLE_HOME%/j2ee/home/config/oc4j-connectors.xml and if commented, uncomment the definition of the connector named OracleASjms. After this step, restart (shutdown and startup) OC4J 10g if necessary. The OC4J JMS resource provider should be loaded and functioning upon restart.g (10.1.3) instance as follows:
Stand Alone Installation: %ORACLE_HOME%/bin/oc4j start
Note that the oc4j command expects the JAVA_HOME environment variable to point to a full JDK installation.
OracleAS Managed Installation: %ORACLE_HOME%/opmn/bin/opmnctl startall
In the top-level %HOWTO_HOME% directory, type the command:
You should now have the newly created jcamdb.ear in your %HOWTO_HOME%/lib directory.
This command would also attempt to deploy the application if the build is successful. It will first test whether OC4J is running.
You might want to modify the onMessage() method in the file %HOWTO_HOME%/src/ejb/bean/simpleMdb.java, to replace some of the hard-coded e-mail addresses to fit your particular environment, before building the demo application. Or you could do the modifications second and rebuild the application.
You can also deploy and bind the application separately by using the following command. Make sure the %ORACLE_HOME% environment variable is defined. In the top-level %HOWTO_HOME% directory, type the command:
In a browser window, browse to:
If the website hostname or port number are different, then use those values instead.
Follow the instructions on the displayed web page to continue with the demo. Use the "Back" button on the result page to go back to the front demo page.
In this document, you should have: