Author |
Message
|
vopros |
Posted: Mon Aug 22, 2005 6:30 am Post subject: Broker command failed:MQRCCF_NOT_AUTHORIZED Reason code 3081 |
|
|
Newbie
Joined: 12 Aug 2005 Posts: 7
|
Hi everybody,
I've already asked for help here http://www.mqseries.net/phpBB2/viewtopic.php?t=23723 , but got no solution.
Now I have developed a little java-program, that connects to MQ, publishes a message and then subscribes. Here is code:
Code: |
MQTopicConnectionFactory tcf = new MQTopicConnectionFactory();
tcf.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
tcf.setQueueManager("xxxxx");
tcf.setHostName("xxxxx");
tcf.setPort(1415);
tcf.setChannel("WAS.JMS.SVRCONN");
Connection conn = tcf.createConnection();
TopicSession sess = (TopicSession)conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
Topic topic = sess.createTopic("com.xxxxx.ClusterTopic");
TopicPublisher publisher = sess.createPublisher(topic);
JMSTextMessage msg = (JMSTextMessage)sess.createTextMessage("Hello world!");
publisher.publish(msg);
TopicSubscriber subscriber = sess.createSubscriber(topic); // Exception in this line :(
|
I'm using Ma0C broker from SupportPac.
First of all, I'm surprised that I'm not asked of user/password or so. When i execute this code, publisher is successfully created and sends the message with no exception (to broker, message doesn't appear in WebSphere MQ Message Browser). Exception is thrown when subscriber is to be created (last line of listing). Here is exception:
Code: |
com.ibm.mq.jms.BrokerCommandFailedException: Broker command failed: MQRCCF_NOT_AUTHORIZED Reason code 3081
at com.ibm.mq.jms.MQBrokerSubscriptionEngine.openSubscription(MQBrokerSubscriptionEngine.java:348)
at com.ibm.mq.jms.MQMigrateSubscriptionEngine.openSubscription(MQMigrateSubscriptionEngine.java:197)
at com.ibm.mq.jms.MQSession.createTSubscriber(MQSession.java:4580)
at com.ibm.mq.jms.MQTopicSession.createSubscriber(MQTopicSession.java:780)
at Test2.tcfTest(Test2.java:47)
|
Broker is running on the server with sysadm as profile. sysadm is member of mqm and mqmbrkrs groups. (does sysadm in this case really need to be member of mqmbrkrs group?)
So I'm confused. Please anybody help me! |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Aug 22, 2005 6:45 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
If there isn't a registered subscriber for a topic (and a few other things), then broker will not publish a real message.
So try creating your subscriber first and see what happens. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Otvet |
Posted: Mon Aug 22, 2005 6:46 am Post subject: Hui tebe a ne otvet |
|
|
Newbie
Joined: 22 Aug 2005 Posts: 1
|
[/url] |
|
Back to top |
|
 |
vopros |
Posted: Mon Aug 22, 2005 7:00 am Post subject: |
|
|
Newbie
Joined: 12 Aug 2005 Posts: 7
|
jefflowrey,
But I cannot create a subscriber because I'm getting MQRCCF_NOT_AUTHORIZED error  |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Aug 22, 2005 7:12 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
vopros wrote: |
jefflowrey,
But I cannot create a subscriber because I'm getting MQRCCF_NOT_AUTHORIZED error  |
Do you *still* get that if you try to create the subscriber *first*? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
vopros |
Posted: Mon Aug 22, 2005 7:19 am Post subject: |
|
|
Newbie
Joined: 12 Aug 2005 Posts: 7
|
jefflowrey wrote: |
Do you *still* get that if you try to create the subscriber *first*? |
Yes, exception is thrown even if I try to create the subscriber first. |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Aug 22, 2005 7:35 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Try explicitly giving the user the necessary rights to the SYSTEM.BROKER.DEFAULT.STREAM queue.
Also try
Code: |
echo "refresh security"|runmqsc |
_________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
jsware |
Posted: Wed Dec 21, 2005 5:13 am Post subject: |
|
|
 Chevalier
Joined: 17 May 2001 Posts: 455
|
I had this response too when the PubSub broker was on a different machine that my JMS subscriber.
What I found was that if you try to register a subscription using JMS, the broker checks that the user ID you are using to register the subscription has the necessary authority to send a message. Thus for me I have missed allowing the subscriber's user ID authority to put messages onto the xmitq from the broker qmgr to my local qmgr hosting the JMS subscriber.
Thus I would guess that you need to check that the JMS subscriber application's user ID has authority to PUT messages onto the subscription queue (e.g. SYSTEM.JMS.ND.SUBSCRIBER.QUEUE) even though you only expect to get messages from it. It seems that the broker attempts to put the message using your subscriber user ID as alternative authority. _________________ Regards
John
The pain of low quaility far outlasts the joy of low price. |
|
Back to top |
|
 |
|