• 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" />
</security-role-mapping>

in orion-ejb-jar
<message-driven-deployment name="RequestProcessor"
   connection-factory-location="java:comp/resource/TibcoJMS/QueueConnectionFactory"
   destination-location="java:comp/resource/TibcoJMS/masRequest"
>
</message-driven-deployment>

in ejb-jar
<message-driven >
...
         <message-driven-destination>
            <destination-type>javax.jms.Queue</destination-type>
         </message-driven-destination>
         <security-identity>
            <run-as>
               <role-name>mas</role-name>
            </run-as>
         </security-identity>
</message-driven>

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

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

Thanks,
Zsolt.
0
riandort
Asked:
riandort
  • 2
  • 2
1 Solution
 
Jim CakalicSenior Developer/ArchitectCommented:
Hi,

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.

Regards,
Jim Cakalic
0
 
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.)

Regards,
Zsolt.
0
 
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...
0
 
Jim CakalicSenior Developer/ArchitectCommented:
Great! You should request an administrator to close the question and refund the points.
:-)
0
 
LunchyCommented:
Closed, 500 points refunded.
Lunchy
Friendly Neighbourhood Community Support Admin
0
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