?
Solved

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

Posted on 2005-04-08
5
Medium Priority
?
506 Views
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" />
</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
Comment
Question by:riandort
  • 2
  • 2
5 Comments
 
LVL 19

Expert Comment

by:Jim Cakalic
ID: 13737153
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
 

Author Comment

by:riandort
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.)

Regards,
Zsolt.
0
 

Author Comment

by:riandort
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...
0
 
LVL 19

Expert Comment

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

Accepted Solution

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

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