Skip to Content

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


to be included in the EAR.

Deploying the EAR file will

result in the automatic deployment of all JMS resources defined in the


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.




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.




Choose Select XML Catalog entry and select the jms-resources.xsd</b>

schema. Choose Next.




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


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 type=a>

<li>For Queue



<p> </p>

<p><li>For Topic destination:</li></p>


1 Comment
You must be Logged on to comment or reply to a post.