Referencing Application Modules In a weblogic-application.xml Descriptor Referencing JMS Resources In a WebLogic Application Referencing JMS Resources In a Java EE Application

4-4 Programming JMS for Oracle WebLogic Server ■ The WebLogic enterprise descriptor file, weblogic-application.xml ■ Any WebLogic deployment descriptor file, such as weblogic-ejb-jar.xml or weblogic.xml ■ Any Java EE descriptor file, such as EJB ejb-jar.xml or WebApp web.xml files

4.1.2.1 Referencing Application Modules In a weblogic-application.xml Descriptor

When including JMS modules in an enterprise application, you must list each JMS module as a module element of type JMS in the weblogic-application.xml descriptor file packaged with the application, and a path that is relative to the root of the Java EE application. Heres an example of a reference to a JMS module name Workflows: module nameWorkflowsname typeJMStype pathjmsWorkflows-jms.xmlpath module

4.1.2.2 Referencing JMS Resources In a WebLogic Application

Within any weblogic-foo descriptor file, such as EJB weblogic-ejb-jar.xml or WebApp weblogic.xml, the name of the JMS module is followed by a pound separator character, which is followed by the name of the resource inside the module. For example, a JMS module named Workflows containing a queue named OrderQueue, would have a name of WorkflowsOrderQueue. resource-env-description resource-env-ref-namejmsOrderQueueresource-env-ref-name resource-linkWorkflowsOrderQueueresource-link resource-env-description Note that the resource-link element is unique to WebLogic Server, and is how the resources that are defined in a JMS Module are referenced linked from the various other Java EE Application components.

4.1.2.3 Referencing JMS Resources In a Java EE Application

The name element of a JMS Connection Factory resource specified in the JMS module must match the res-ref-name element defined in the referring EJB or WebApp application descriptor file. The res-ref-name element maps the resource name used by java:compenv to a module referenced by an EJB. For Queue or Topic destination resources specified in the JMS module, the name element must match the resource-env-ref field defined in the referring module descriptor file. That name is how the link is made between the resource referenced in the EJB or Web Application module and the resource defined in the JMS module. For example: resource-ref res-ref-namejmsOrderQueueFactoryres-ref-name res-typejavax.jms.ConnectionFactoryres-type resource-ref resource-env-ref resource-env-ref-namejmsOrderQueueresource-env-ref-name resource-env-ref-typejavax.jms.Queueresource-env-ref-type resource-env-ref Enhanced Support for Using WebLogic JMS with EJBs and Servlets 4-5

4.1.3 Declaring JMS Destinations and Connection Factories using Annotations