Skip to Content
author's profile photo Former Member
Former Member

JMS Configuration

Hello,

I am trying to deploy my enterprise application in SAP WAS. The application interfaces with an extrnal standalone Java Client through JMS queues. I have a MessageConsumerBean in the J2EE application. I am struggling with a few questions at this stage

1. Do i have to define a JMS connector for my application to work? if yes where would the jms-factories.xml sit? inside the EAr file?

2. Do i need to specify references to the QueueConnectionfactory and Destination Queue in both the ejb-jar.xml and ejb-j2ee-engine.xml? What is the difference?

3. In the Visual Admin tool, under Services I can see two children - JMS Provider and JMS Connector and it seems i can create QueueConnectionfactory and Queues under both the children, what is the diference in creating a Queue under the JMS Provider/Runtime as opposed to under the JMS Connector?

Any help is highly appreciated

Thanks

Dushy

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Oct 27, 2005 at 07:30 AM

    Hi Dushy,

    >> 1. Do i have to define a JMS connector for my >>application to work? if yes where would the jms->>factories.xml sit? inside the EAr file?

    Depends on what you want to do in you application. If you're using an external JMS provider, then yes, you need to use the JMS connector to set your JMS provider to work with your app. More info on that - herehttp://help.sap.com/saphelp_nw04/helpdata/en/22/cf4e71c46cdb4da31153be96c5389f/frameset.htm">here>.

    Apart from that, the Web AS Java provides its own JMS implementation - located in the JMS Provider service. You can use that out-of-the-box. More info herehttp://help.sap.com/saphelp_nw04/helpdata/en/90/57849e5e3e45d784afc4e3bfa8136f/frameset.htm">here>.

    >>2. Do i need to specify references to the >>QueueConnectionfactory and Destination Queue in both >>the ejb-jar.xml and ejb-j2ee-engine.xml? What is the >>difference?

    In ejb-jar.xml you define the reference (i.e. name, type, etc.). In ejb-j2ee-engine.xml you "map" the reference name from the ejb-jar.xml to, for example, the real factory name (as defined in the jms-factories.xml). For more information, see the DTD of the ejb-j2ee-engine.xml herehttp://help.sap.com/saphelp_nw04/helpdata/en/37/30c557fad05341a951cfd051bf0b44/frameset.htm">here>.

    The answer to your 3rd question is given with the answer to the 1st one above - the difference is that you manage factories, etc. for different JMS providers.

    Hope that helps!

    Message was edited by: Ivaylo Ivanov

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Steven De Saeger

      Hi,

      The problem here is that <res-link> should point to name which is defined in jms connector which makes connection beetween jms provider and j2ee containers. So for this case you should have jms-factories.xml file located in META-INF folder of application archive which should contains:

      <?xml version="1.0" encoding="UTF-8" ?>

      <jms-factories>

      <connection-factory>

      <factory-name>

      jmsfactory/default/QueueConnectionFactory

      </factory-name>

      <context-factory-type>

      <link-factory-name>

      jmsfactory/default/XAQueueConnectionFactory

      </link-factory-name>

      <initial-context-factory> com.sap.engine.services.jndi.InitialContextFactoryImpl

      </initial-context-factory>

      <provider-url>

      </provider-url>

      <security-principal>

      </security-principal>

      <security-credentials>

      </security-credentials>

      </context-factory-type>

      </connection-factory>

      </jms-factories>

      You also have easier solution without additional info in web-j2ee-engine.xml, if you want to use it please remove

      <resource-ref>

      <res-ref-name>QueueFactory</res-ref-name>

      <res-link>jmsfactory/default/QueueConnectionFactory</res-link>

      </resource-ref>

      from web-j2ee-engine.xml. And add jms-factories.xml with:

      <?xml version="1.0" encoding="UTF-8" ?>

      <jms-factories>

      <connection-factory>

      <factory-name>

      QueueFactory

      </factory-name>

      <context-factory-type>

      <link-factory-name>

      jmsfactory/default/XAQueueConnectionFactory

      </link-factory-name>

      <initial-context-factory> com.sap.engine.services.jndi.InitialContextFactoryImpl

      </initial-context-factory>

      <provider-url>

      </provider-url>

      <security-principal>

      </security-principal>

      <security-credentials>

      </security-credentials>

      </context-factory-type>

      </connection-factory>

      </jms-factories>

      I hope this helps.

      Best Regards Nikola

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.