Author |
Message
|
cpeele |
Posted: Thu Apr 19, 2007 5:31 am Post subject: User is not authorized error |
|
|
Acolyte
Joined: 04 Apr 2007 Posts: 53
|
Hey guys, I have a publisher XMS.NET app that works fine on my local MQ server, however now when I try to use it with our dev MQ server (with the default configuration created by the wizard) in our workgroup I receive the following:
Code: |
Exception : IBM.XMS.IllegalStateException: CWSMQ0044E: The user is not authorized to connect to the queue manager. The application has tried to connect to a queue manager without authorization. |
I'm very new to the world of WebSphere MQ and not sure what the problem may be. Any help would be greatly appreciate and needed. - Thanks!
Here's the code:
Code: |
//create the connection factory
XMSFactoryFactory ff = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);
IConnectionFactory cf = ff.CreateConnectionFactory();
//set the properties
cf.SetStringProperty(XMSC.WMQ_HOST_NAME, _host);
cf.SetStringProperty(XMSC.WMQ_PORT, _port);
cf.SetStringProperty(XMSC.WMQ_CONNECTION_MODE, _mode);
cf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, _queueManager);
using (IConnection connection = cf.CreateConnection())
{
PublisherUtils.WriteText("Connection created", this.OutputListBox);
using (ISession session = connection.CreateSession(false, AcknowledgeMode.AutoAcknowledge))
{
PublisherUtils.WriteText("Session created", this.OutputListBox);
using (IDestination destination = session.CreateTopic(_topic))
{
PublisherUtils.WriteText("Destiniation created", this.OutputListBox);
using (IMessageProducer publisher = session.CreateProducer(destination))
{
PublisherUtils.WriteText("Publisher created", this.OutputListBox);
//start the connection
connection.Start();
//create a text message
IMessage sendMsg = session.CreateTextMessage(messageToSend);
//send the message using the sender
publisher.Send(sendMsg);
PublisherUtils.WriteText(sendMsg, this.OutputListBox);
PublisherUtils.WriteText("Message sent!", this.OutputListBox);
}//IMessageProducer
PublisherUtils.WriteText("Publisher closed", this.OutputListBox);
}//IDestination
}//ISession
PublisherUtils.WriteText("Session closed", this.OutputListBox);
}//IConnection
PublisherUtils.WriteText("Connection closed", this.OutputListBox);
//we're finished
PublisherUtils.WriteText("Sample execution SUCCESSFUL", this.OutputListBox);
}
catch (XMSException e)
{
PublisherUtils.WriteText(e.Message, this.OutputListBox);
PublisherUtils.WriteText("Sample execution FAILED!", this.OutputListBox);
}
catch (Exception e)
{
PublisherUtils.WriteText(e.Message, this.OutputListBox);
PublisherUtils.WriteText("Sample execution FAILED!", this.OutputListBox);
}
|
[/code] |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Thu Apr 19, 2007 6:27 am Post subject: Re: User is not authorized error |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
You should set user rights by setmqaut command.
Then you can use dspmqaut command to read user rights.
Description of this commands you can find in docs. _________________ Marcin |
|
Back to top |
|
 |
cpeele |
Posted: Thu Apr 19, 2007 10:17 am Post subject: |
|
|
Acolyte
Joined: 04 Apr 2007 Posts: 53
|
Hello and thanks for the reply!
I have some questions. I'm reading the documentation on it right now. What ObjectType would a XMS.NET app fall under? A service? Process? Client connection channel?
Also, what do I need to set in my XMS.NET code to interact with the permissions? A Username? Security settings property?
Thanks again for your help! |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Thu Apr 19, 2007 10:31 am Post subject: |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
cpeele wrote: |
Hello and thanks for the reply!
I have some questions. I'm reading the documentation on it right now. What ObjectType would a XMS.NET app fall under? A service? Process? Client connection channel?
Also, what do I need to set in my XMS.NET code to interact with the permissions? A Username? Security settings property?
Thanks again for your help! |
I'm not familiar with XMS.NET but here it doesn't matter.
ObjectType here is MQ ObjectType.
In common situation your application try to interact with qmgr (connect) and queue (get, put, set). You have to set permitions for your user to objecttype qmgr and queue. What kind of rights it depends on your application. _________________ Marcin |
|
Back to top |
|
 |
cpeele |
Posted: Thu Apr 19, 2007 10:40 am Post subject: |
|
|
Acolyte
Joined: 04 Apr 2007 Posts: 53
|
Hello,
There is no user. It's just an publish/subscribe application.
Can you explain a little further please?
Thanks again! |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Apr 19, 2007 11:06 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
There is a user.
It is the user that started the application. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
cpeele |
Posted: Thu Apr 19, 2007 11:22 am Post subject: |
|
|
Acolyte
Joined: 04 Apr 2007 Posts: 53
|
So the account that logged in into the operating system then or the name of the computer on which the XMS.NET application resides? |
|
Back to top |
|
 |
Michael Dag |
Posted: Thu Apr 19, 2007 11:40 am Post subject: |
|
|
 Jedi Knight
Joined: 13 Jun 2002 Posts: 2607 Location: The Netherlands (Amsterdam)
|
yes, the account the user is logged in with running the application OR
if the application is running as a windows service, the userid of the service.
there is ALWAYS a userid ... _________________ Michael
MQSystems Facebook page |
|
Back to top |
|
 |
cpeele |
Posted: Thu Apr 19, 2007 11:42 am Post subject: |
|
|
Acolyte
Joined: 04 Apr 2007 Posts: 53
|
Great! Thanks for the help guys! |
|
Back to top |
|
 |
|