Calling a 3rd party JMS server with username/password from MDB

Posted on 2005-04-08
Last Modified: 2008-02-26
I have to use a Message Driven Bean on an Oracle IAS (oc4j) 9.0.4. It should listen on a queue that is on a separate JMS server (tibco). I have defined a resource-provider in orion-application.xml that maps the QueueConnectionFactory and the queue to the IAS JNDI tree. This seem to work using the correct username and password. However I don't know how to specifiy the username and password that the MDB should use, when it creates the queue connection, which also needs a username password. Based on the analysis of the network communications I presume, that the mapping is correct and uses the given credentials, while the MDB always try to connect with anonymous and thus fails. I have the following configs:

in orion-application:
<security-role-mapping name="mas">
    <user name="mas" />

in orion-ejb-jar
<message-driven-deployment name="RequestProcessor"

in ejb-jar
<message-driven >

in principals.xml
            <group name="mas">
                  <description>Group for MAS</description>
            <user username="mas" password="mas">
                  <description>MAS jms user credentials</description>
                  <group-membership group="mas" />

What is the correct way to tell the MDB to use the username: mas and password: mas when it tries to connect to the queue? (like in Jboss the <mdb-user>, <mdb-pwd>)

Question by:riandort
    LVL 19

    Expert Comment

    by:Jim Cakalic

    I see two possibilities at the moment.
    1) Add username and password properties to the queue-connection-factory definition in jms.xml.
    2) Use QueueConnectionFactory.createQueueConnection(String username, String password) in your code.

    Jim Cakalic

    Author Comment

    Hi Jim,

    1. You might have not noticed that the JMS server in this case is a 3rd party server. Naturally, it is not configured in the jms.xml.

    2. I do not create the connection in the code (that works of course), it is done by the applications server during Message Driven Bean deployment. This can only be configured in the deployment descriptors. (At least for other application servers.)


    Author Comment

    In the mean time, the problem has been "solved". It turned out, that this is a bug in oc4j 9.0.4. The OrionServerSessionPool class that makes the createQueueConnection() call, always does it without credentials. What's more, there is no way to define the username and password in the descriptors either.

    This was a bug in 10.1.2 as well, and a patch was issued that introduced two attributes to the <message-drive-destination> tag in orion-ejb-jar.xml (res-user and res-password). We succeeded in patching 9.0.4 with the 10.1.2 patch, and now it works...
    LVL 19

    Expert Comment

    by:Jim Cakalic
    Great! You should request an administrator to close the question and refund the points.
    LVL 2

    Accepted Solution

    Closed, 500 points refunded.
    Friendly Neighbourhood Community Support Admin

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    zeroMAx challenge 20 66
    Return ZipOutputStream using Servlet 2 27
    hasOne  challenge 59 66
    pairstar challenge 2 26
    Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
    Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
    This video teaches viewers about errors in exception handling.
    This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now