Need help to create your Enterprise Java Beans project? This tip from SAP Developer Network walks you through the process of creating a JMS resources deployment descriptor and implementing the configuration XML schema file.
In the process of developing a Java EE application in any 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.xml has 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, then XML. Choose Next.
- Choose Create XML file from an XML schema file and then Next.
- 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
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 jms-resources.xml file. One of the portions of this file sets up
the connection factory and the destination.
Here is how my descriptor looks after adding manually the JMS resources. First, you have to declare the <connection-factory> tag, and afterwards
the definition of the destinations.
- For Queue destination:
- For Topic destination:
Afterward, you can continue developing and deploying your Java EE Application.
For more information, refer to:
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/55e7d5
1e-0e01-0010-7b84-a95ee55eadeb
Ekaterina Anachkova is an information developer at SAP Labs Bulgaria.
This content is reposted from the SAP Developer Network.
Copyright 2007, SAP Developer Network
SAP Developer Network (SDN) is an active online community where ABAP, Java, .NET, and other cutting-edge technologies converge to form a resource and collaboration channel for SAP developers, consultants, integrators, and business analysts. SDN hosts a technical library, expert blogs, exclusive downloads and code samples, an extensive eLearning catalog, and active, moderated discussion forums. SDN membership is free.
Want to read more from this author? Click here to read Ekaterina Anachkova's Weblog. Click here to read more about Application Servers on SDN.