ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » User is not authorized error

Post new topic  Reply to topic
 User is not authorized error « View previous topic :: View next topic » 
Author Message
cpeele
PostPosted: Thu Apr 19, 2007 5:31 am    Post subject: User is not authorized error Reply with quote

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
View user's profile Send private message
marcin.kasinski
PostPosted: Thu Apr 19, 2007 6:27 am    Post subject: Re: User is not authorized error Reply with quote

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
View user's profile Send private message Visit poster's website
cpeele
PostPosted: Thu Apr 19, 2007 10:17 am    Post subject: Reply with quote

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
View user's profile Send private message
marcin.kasinski
PostPosted: Thu Apr 19, 2007 10:31 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
cpeele
PostPosted: Thu Apr 19, 2007 10:40 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Thu Apr 19, 2007 11:06 am    Post subject: Reply with quote

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
View user's profile Send private message
cpeele
PostPosted: Thu Apr 19, 2007 11:22 am    Post subject: Reply with quote

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
View user's profile Send private message
Michael Dag
PostPosted: Thu Apr 19, 2007 11:40 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
cpeele
PostPosted: Thu Apr 19, 2007 11:42 am    Post subject: Reply with quote

Acolyte

Joined: 04 Apr 2007
Posts: 53

Great! Thanks for the help guys!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » User is not authorized error
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.