Using JMS Resources in Java EE Applications (EJB, MDB, Servlets, JSPs etc.)
In the process of developing Java EE application in particular
Message Driven Bean you have to perform
several tasks.
You need to create an EJB project, where you set up the message
driven bean. You also create
an Enterprise Application Project (EAR) and the
JMS resources xml, where you declare the connection
factories and the
destinations needed for the application. The
jms-resources.xmlhas
to be included in the EAR.
Deploying the EAR file will
result in the automatic deployment of all JMS resources defined in the
jms-resources.xml
file. The XML file will be packaged in the EAR file. Put this XML file under
the META-INF directory.
Creating the JMS resources deployment descriptor
From +the META-INF +context menu of the +MDBEar, +choose
+New… +® +Other… ® XML…. +Choose Next.
0.1.
Choose +Create XML file from an XML schema file +and
then Next.
0.1. Specify the Project, in our example MDBEar, and the
META-INF, where you will create the
+jms-resources.xml +
and choose Next.
0.1.
Choose Select XML Catalog entry and select the jms-resources.xsd</b>
schema. Choose Next.
0.1.
Choose Finish.
Implementing the
configuration XML Schema file
To implement the configuration XML Schema file, navigate to META-INF in your Enterprise
Application Project and open the
jms-resources.xml</b>
file. One of the portions of this file sets up <br> the connection factory and the destination. </p>
<p> </p>
<p>Here is how my descriptor looks after adding manually the JMS resources, first you have to declare the <br> <connection-factory> tag, and afterwards
the definition of the destinations.</p>
</ol>
<ol type=a>
<li>For Queue
destination:</li>
<p> </p>
<p><li>For Topic destination:</li></p>




