This action might not be possible to undo. Are you sure you want to continue?
(AQ-JMS). We will be creating a J2EE application that utilizes the Servlet, Message Driven Bean, and Java Message Service (JMS) API's. Instructions are provided for how to develop, assemble, configure, and deploy the application to the standalone version of Oracle Containers for J2EE (OC4J). This example will include an Enterprise Application Archive (EAR) consisting of two modules:
Application Name = OracleJmsApp o Enterprise Java Bean Module - (OracleJmsEJB) This module will contain a single Message Driven Bean (MDB) named parallelMDBBean. The purpose of this bean is to accept incoming JMS messages that describe a task or job. Each job will use JDBC to insert a fixed number of rows into a database table. The quantity of rows inserted into the table and their field values will be communicated through attributes of the JMS message. The table name will be dataset and will be created dynamically by the application. The table will have the following fields:
Name INSERT_DT ID Type DATE NUMBER(4)
The Message Driven Mean will use the INSERT_DT value for all rows inserted by the same job. By doing this, the order in which job processing occurred and any parallelism whithin the concurrent execution of multiple MDB's can be observed.
Web Archive Module - (OracleJmsWeb) - (Context Root = /OracleJms) The Web module implements two servlets:
Format of the EAR File The format of the EAR file is as follows:
META-INF | | | | | |.xml | |.0. Netscape Users: Hold down the SHIFT key while linking on the link.web. you will need the following: • OC4J 9.2 (Patch: 2632931) Deployment Process Now let's take a look at how to deploy our J2EE application.jar) | | | |.class |.e.4 (Patch: 2517300) Oracle9i Database 9. Pre-requisites To run the example in this article.0. select "Save Target As.classes | |.orion-web.ejb-jar.0 • Supported Oracle RDBMS Version o o Oracle9i Database 9. one that is not being ..0.ear) | |.xml | | | |.war) | |-WEB-INF | |.OracleJmsWeb(.ear. Internet Explorer Users: Right click on the link and in the pop-up menu. (i.listDataSet Download the EAR File You can download the test Enterprise Archive (EAR) file from the following link: OracleJmsApp.2.orion-ejb-jar.0.application.class | |.parallelMDBBean.3.jobSubmit.xml | | |..".xml | |. The configuration changes in this section refer to a standalone OC4J instance.1.xml |.META-INF | | | |.OracleJmsApp(.ear NOTE: Save the file as OracleJmsApp.OracleJmsEJB(.
GRANT create type TO aq_admin. primary_instance => '0' . sort_list => '' .NONE . compatible => '8. message_grouping => DBMS_AQADM. queue_payload_type => 'SYS. COMMIT.CREATE_QUEUE_TABLE( queue_table => 'JMS_TEXT' . non_repudiation => DBMS_AQADM. ALTER USER aq_admin QUOTA UNLIMITED ON users. CONNECT aq_admin/aq_admin BEGIN DBMS_AQADM. comment => '' . storage_clause => '' . Configure an Oracle AQ table and queue for our application For the purpose of this example. secondary_instance => '0' ). GRANT aq_administrator_role TO aq_admin. the AQ table will be run by the Oracle user "AQ_ADMIN/AQ_ADMIN" created on a database named "O920NT": CONNECT system/manager CREATE USER aq_admin IDENTIFIED BY aq_admin DEFAULT TABLESPACE users TEMPORARY TABLESPACE temp.1' . GRANT connect TO aq_admin. . then changes can be applied either: • • Using the Web Administration screens of the Oracle Enterprise Manager (OEM) web site. multiple_consumers => FALSE . By shutting down the OEM web site (emctl stop) and applying all changes to configuration files manually and on completion and then running the command: dcmctl updateConfig -ct oc4j -co <OC4J Instance Name> 1.managed by the Distributed Component Management (DCM) component that comes with the full 9iAS release.grant_type_access('aq_admin'). EXECUTE dbms_aqadm.AQ$_JMS_TEXT_MESSAGE' .NONE .) If you are using an OC4J instance being managed by the DCM (within the full release of 9iAS).
Lastly. retry_delay => '0' . COMMIT. END. named "JMS_QUEUE" will then be created using the "JMS_TEXT" table as its queue table. (using its full schema. queue_type => DBMS_AQADM. / SHOW ERRORS NOTE: o o A special table named "JMS_TEXT" will be created in the designated schema in order to support the TextMessage type of JMS.job_queue'. TRUE. (e. Create a Container Wide Datasource Definition Now.xml) Add the following data-source. END.object notation) o 2. which should reference the schema containing the Queue defined above: .START_QUEUE('aq_admin.xml file located in $ORACLE_HOME/j2ee//config/data-sources. / SHOW ERRORS BEGIN DBMS_AQADM. retention_time => '0' .NORMAL_QUEUE . A JMS Queue.END.xml. the "JMS_QUEUE" queue will be started.CREATE_QUEUE( queue_name => 'JOB_QUEUE' . queue_table => 'JMS_TEXT' . $ORACLE_HOME/j2ee/home/config/data-sources. COMMIT. edit the data-sources. TRUE). comment => '' ). / SHOW ERRORS BEGIN DBMS_AQADM.g. max_retries => '5' .
OjmsContext" name="ojms"> <description>OJMS Context Using a datasource</description> <property name="url" value="jdbc:oracle:thin:aq_admin/aq_admin@bartman:1521:O920NT" /> <property name="username" value="aq_admin" /> <property name="password" value="aq_admin" /> </resource-provider> . Create a Container Wide Resource-Provider Definition Insert the following definition into the "application. password and JDBC URL must be correctly set to reference the database and schema where the queue was setup.xml) <resource-provider class="oracle.g.sql. which for this example is "aq_admin_o920nt". 3. In this example application.jms.jdbc. the data source will be used as the target for SQL insert statements issued by the Message Driven Bean (MDB) to add rows to the "dataset" table.OracleDriver" username="aq_admin" password="aq_admin" url="jdbc:oracle:thin:@bartman:1521:O920NT" inactivity-timeout="30" /> NOTE: o o The username. This file is located in $ORACLE_HOME/j2ee//config directory.<data-source class="com. It will also be used by thelistDataSet servlet to display the current contents of this table. $ORACLE_HOME/j2ee/home/config/application. This entry will be mapped within the JNDI namespace at the path provided as the location attribute.driver. (e.xml" file.DriverManagerDataSource" name="aq_admin_o920nt" location="jdbc/aq_admin_o920nt" xa-location="jdbc/xa/aq_admin_o920nt" ejb-location="jdbc/aq_admin_o920nt" connection-driver="oracle.evermind.
(Optional) Propagating Configuration Changes to the DCM Repository This is an optional step and is only required if you are using an OC4J instance that is being managed by the Distributed Component Management (DCM) component that comes with the full 9iAS release. ppF-9 .0.902/a92171.pdf Appendix F: DCM Command-Line Utility (dcmctl) "Managing Applications".NOTE: o o The class "oracle. see: o updateConfig" command line Oracle9i Application Server: Administrator's Guide Release 2 (9. username and password attributes needs to be consistent with the database schema from step  where we create the Oracle AQ resources.jms.2) May 2002 Part No. The value of the url. 4. all configuration changes are maintained within a central configuration repository and it is necessary to use the "dcmctl updateConfig" command to propagate configuration changes to the central configuration repository: % dcmctl updateConfig -ct oc4j -co home -v -d For further information on the "dcmctl options. A92171-02 http://downloadwest.oracle.com/docs/cd/A97329_03/core. In the case of OC4J instances being managed by teh DCM.OjmsContext" implements the Oracle AQJMS functionality and the name attribute will be used later to reference Oracle AQ-JMS resources such as Queue's and Queue Connection Factories from the JNDI namespace.
.ear) File You can download the test Enterprise Archive (EAR) file from the following link: OracleJmsApp.ear to the OC4J instance's application directory: (e.. Internet Explorer Users: Right click on the link and in the pop-up menu. select "Save Target As. Define the new OC4J Web application by editing the http-website.". Download the OracleJmsApp Enterprise Archive (OracleJmsApp.ear" auto-start="true" /> 3. 6.xml file by adding a new XML <web-app> element as follows: <web-app application="OracleJmsApp" name="OracleJmsWeb" root="/OracleJms" /> . you will need to deploy it to the standalone OC4J application server using manual methods. 1..ear NOTE: Save the file as OracleJmsApp.g $ORACLE_HOME/j2ee/home/applications) 2.ear.5.xml file by adding a new XML <application> element as follows: <application name="OracleJmsApp" path=".ear File After downloading the Enterprise Archive file. Deploy the Enterprise Archive OracleJmsApp. Netscape Users: Hold down the SHIFT key while linking on the link./applications/OracleJmsApp. Define the new OC4J application by editing the server. Copy the OracleJmsApp.
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue listening from where you left off, or restart the preview.