Author |
Message
|
lifeng |
Posted: Thu Jan 31, 2008 3:18 pm Post subject: "MQRC_NOT_AUTHORIZED" exception on new MQQueueMana |
|
|
Apprentice
Joined: 11 Jan 2008 Posts: 46
|
Hi,
I am accessing MQ API from .Net app through MQ for .Net. Now I am trying to create an intance of queue manger by calling:
MQQueueManager * mqQMgr = new MQQueueManager(qmname);
Here, qmname contains my valid queue name. What I got from this line however is an exception with a clsName = "MQException" and a message = "MQRC_NOT_AUTHORIZED". I can't figure out what is wrong. I can tell that my queue works fine because my other app can access the same queue using the same name.
Can someone tell me what might be my problem?
Thanks in advance!
Lifeng |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Jan 31, 2008 3:24 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Check out the .NET manual and examples... and don't create a qmgr with a qname!
Use a user that has been given rights to the qmgr and queues it needs to access...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
PeterPotkay |
Posted: Thu Jan 31, 2008 4:17 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
Turn on Autority Events at the Queue Manager level and they will tell you exactly what ID is failing on what MQ API call. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
lifeng |
Posted: Fri Feb 01, 2008 8:59 am Post subject: |
|
|
Apprentice
Joined: 11 Jan 2008 Posts: 46
|
fjb_saper wrote: |
Check out the .NET manual and examples... and don't create a qmgr with a qname!
Use a user that has been given rights to the qmgr and queues it needs to access...  |
Thank you guys for the inputs!
fjb_saper,
I guess I picked a bad variable name for the queue manger but the name is queue manager's name, not a queue name. I think the second thing you pointed out, the user rights, is where my problem is. Like I said, I have a testing app using exactly the same queue manager, queue and AIP but it works. The only difference is that the test app and the real app are running under different user's acount. My problem now is that I don't know how to find out what user are allowed to do what on MQ and how to change the user rights. I was looking for it using MQ Explorer but couldn't seem to find anything.
Can you point me to the right direction?
Thanks again!
Lifeng |
|
Back to top |
|
 |
lifeng |
Posted: Fri Feb 01, 2008 11:53 am Post subject: |
|
|
Apprentice
Joined: 11 Jan 2008 Posts: 46
|
I thought my app was running under ASP.Net worker process' user account when calling MQ API. Well, I might be wrong (I still doubt it though). What I did was adding ASPNET as a member of mqm group. According to IBM MQ document, that should be all I need if ASPNET is the user making the call.
I also took recommendation from PeperPotKay and turned on Autority Events at the Queue Manager level. But that doesn't seem to do anything.
Do I have to reboot the machine after I have done all of these? Other than that, I just can't think of anything else.
Please advise!
Thanks.
Lifeng |
|
Back to top |
|
 |
lifeng |
Posted: Fri Feb 01, 2008 12:22 pm Post subject: |
|
|
Apprentice
Joined: 11 Jan 2008 Posts: 46
|
I got pass that point by refreshing the queue manger. Now I can continue my work. But still, I don't think I should make ASPNET a member of mqm all the time, right? If I just want ASPNET to be able to call all the API's, such as QMCONN, QMOPEN, QMPUT, QMGET, etc., what do I do?
Thanks.
Lifeng |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Feb 01, 2008 2:13 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
checkout the line commands:
setmqaut (set)
dismqaut (display)
dmpmqaut (dump )
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
PeterPotkay |
Posted: Fri Feb 01, 2008 3:16 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
Once you turn on authority events for the QM, you then have to create an MQ security error and then go look in the SYSTEM.ADMIN.QMGR.EVENT queue. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
PeterPotkay |
Posted: Fri Feb 01, 2008 3:16 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
Once you turn on authority events for the QM, you then have to create an MQ security error and then go look in the SYSTEM.ADMIN.QMGR.EVENT queue. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
lifeng |
Posted: Sun Feb 03, 2008 4:15 pm Post subject: |
|
|
Apprentice
Joined: 11 Jan 2008 Posts: 46
|
Hi fjb_saper,
I was trying to find those line commands from both "MQ Sphere contact admin Center" and "WebSphere MQ Using .Net" document but I couldn't find anything. I must be missing some important doc/references. Could you point me to the right direction?
Thanks again!
Lifeng |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Feb 03, 2008 4:59 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
lifeng wrote: |
Hi fjb_saper,
I was trying to find those line commands from both "MQ Sphere contact admin Center" and "WebSphere MQ Using .Net" document but I couldn't find anything. I must be missing some important doc/references. Could you point me to the right direction?
Thanks again!
Lifeng |
Go to the repository (top navigation) and look for the infocenter (links are peppered all over the forum). I believe the security manual is what you are looking for...
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|