• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 512
  • Last Modified:

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

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>)

  • 2
  • 2
1 Solution
Jim CakalicSenior Developer/ArchitectCommented:

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
riandortAuthor Commented:
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.)

riandortAuthor Commented:
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...
Jim CakalicSenior Developer/ArchitectCommented:
Great! You should request an administrator to close the question and refund the points.
Closed, 500 points refunded.
Friendly Neighbourhood Community Support Admin
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now