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

Posted on 2005-04-08
Medium Priority
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
  • 2
  • 2
LVL 19

Expert Comment

by:Jim Cakalic
ID: 13737153

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

ID: 13738057
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

ID: 13738152
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
ID: 13739374
Great! You should request an administrator to close the question and refund the points.

Accepted Solution

Lunchy earned 0 total points
ID: 13740515
Closed, 500 points refunded.
Friendly Neighbourhood Community Support Admin

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses
Course of the Month16 days, 23 hours left to enroll

864 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