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 » Issue while publishing in MQ V7

Post new topic  Reply to topic
 Issue while publishing in MQ V7 « View previous topic :: View next topic » 
Author Message
rakent
PostPosted: Tue Jul 14, 2009 12:26 pm    Post subject: Issue while publishing in MQ V7 Reply with quote

Newbie

Joined: 28 Sep 2005
Posts: 7

I wrote a Java code to publish the message to the MQ V7.0. I am getting the error while executiong.

Error:
#########################################################################
Is connected true
***Publishing ***
MQJE001: Completion Code '2', Reason '2051'.
MQ Exception in the publish :com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2051'.
#########################################################################
Script ended : Tue Jul 14 15:21:49 CDT 2009. Can anyone help me on this.

Code is copied below. I am exporting /usr/mqm/java/lib/com.ibm.mq.jmqi.jar:/usr/mqm/java/lib/com.ibm.mq.jar:

import com.ibm.mq.*;
import com.ibm.mq.constants.CMQC;
import com.ibm.mq.jmqi.*;

import java.util.*;
import java.io.*;

public class pub {
private Properties prop;
private String sHostName;
private String sSvrConName;
private String sPort;
private String sQueueManagerName;
private String sourceQueueName;
private int sourceQOpenOptions;
private FileInputStream fis;
private String topicObject;
private MQQueueManager sQmgr;
private MQQueue sourceQ;
private MQMessage mesg;
private MQPutMessageOptions pmo;
private MQGetMessageOptions gmo;

private void readConfigFile() {
try{
prop = new Properties();
fis = new FileInputStream(new File(
"/home/mqm/pubTest/PubSubConfig.txt"));
prop.load(fis);
sHostName = prop.getProperty("S_HOSTNAME");
sSvrConName = prop.getProperty("S_SERV_CHANNEL");
sPort = prop.getProperty("S_PORT");
sQueueManagerName = prop.getProperty("S_QUEUE_MANAGER_NAME");
sourceQueueName = prop.getProperty("S_QNAME");
topicObject = "MONEY";

}catch(IOException IOE){
System.out.println(" Exception Occured in the readConfigFile Function : " + IOE);
}
}
private void publish(){
MQEnvironment.hostname = sHostName;
MQEnvironment.channel = sSvrConName;
MQEnvironment.port = Integer.parseInt(sPort);
int destinationType = CMQC.MQOT_TOPIC;

try{
MQQueueManager queueManager = new MQQueueManager(sQueueManagerName);
MQMessage messageForPut = new MQMessage();
System.out.println(" Is connected " + queueManager.isConnected());
System.out.println("***Publishing ***");
messageForPut.writeString("Hello world!");
queueManager.put(destinationType, topicObject, messageForPut);
queueManager.disconnect();
}catch(MQException mqe){
System.out.println(" MQ Exception in the publish :" +mqe);
}catch(IOException ioe){
System.out.println(" IO Exception in the publish :" + ioe);
}
}

public static void main(String arg[]){
pub pubo = new pub();
pubo.readConfigFile();
pubo.publish();
}

}
Back to top
View user's profile Send private message
bruce2359
PostPosted: Tue Jul 14, 2009 12:39 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9394
Location: US: west coast, almost. Otherwise, enroute.

Quote:
Completion Code '2', Reason '2051'.

And when you looked up ReasonCode 2051, what did it say was the cause and resolution?
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
rakent
PostPosted: Wed Jul 15, 2009 6:13 am    Post subject: Reply with quote

Newbie

Joined: 28 Sep 2005
Posts: 7

$ mqrc 2051

2051 0x00000803 MQRC_PUT_INHIBITED

mqm@mw95tst1 [/usr/java5/bin]
Back to top
View user's profile Send private message
bruce2359
PostPosted: Wed Jul 15, 2009 6:31 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9394
Location: US: west coast, almost. Otherwise, enroute.

And what this means is that someone or something has set the queue to put-inhibited; which means that your app cannot put messages to the queue until someone or something put-enables the queue.

Find out why the queue was put-inhibited. Ask that the queue be put-enabled. Try your application again.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
shashikanth_in
PostPosted: Wed Jul 15, 2009 8:13 pm    Post subject: Reply with quote

Centurion

Joined: 26 Feb 2009
Posts: 123

MQRC 2051 is because you do not have Publish authority on topic "MONEY". Contact MQ Adminstrator to get you required authority on for your topic.

HTH
Back to top
View user's profile Send private message
rakent
PostPosted: Thu Jul 16, 2009 6:13 am    Post subject: Reply with quote

Newbie

Joined: 28 Sep 2005
Posts: 7

I am MQ Admin. So there should be no issues with the permissions. I checked for the queues in the queue manager. All the queues are put enabled.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Thu Jul 16, 2009 6:15 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9394
Location: US: west coast, almost. Otherwise, enroute.

Topics are secured like queues - with OAM and setmqaut control command.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
rakent
PostPosted: Thu Jul 16, 2009 6:40 am    Post subject: Reply with quote

Newbie

Joined: 28 Sep 2005
Posts: 7

dspmqaut -m MSRT324 -t topic -n MONEY -g mqm
Entity mqm has the following authorizations for object MONEY:
pub
sub
resume
crt
dlt
chg
dsp
passid
passall
setid
setall
clr
ctrl
Back to top
View user's profile Send private message
bruce2359
PostPosted: Thu Jul 16, 2009 6:54 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9394
Location: US: west coast, almost. Otherwise, enroute.

What did you find in the mq error log(s) for this?
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
rakent
PostPosted: Thu Jul 16, 2009 7:09 am    Post subject: Reply with quote

Newbie

Joined: 28 Sep 2005
Posts: 7

07/16/09 10:08:20 - Process(1142940.66) User(mqm) Program(amqrmppa)
AMQ9209: Connection to host MSRT324 closed.

EXPLANATION:
An error occurred receiving data from 'MSRT324 ' over TCP/IP.
The connection to the remote host has unexpectedly terminated.
ACTION:
Tell the systems administrator.
----- amqccita.c : 3396 -------------------------------------------------------
07/16/09 10:08:20 - Process(1142940.66) User(mqm) Program(amqrmppa)
AMQ9999: Channel program ended abnormally.

EXPLANATION:
Channel program 'SYSTEM.DEF.SVRCONN' ended abnormally.
ACTION:
Look at previous error messages for channel program 'SYSTEM.DEF.SVRCONN' in the
error files to determine the cause of the failure.
Back to top
View user's profile Send private message
shashikanth_in
PostPosted: Thu Jul 16, 2009 9:49 am    Post subject: Reply with quote

Centurion

Joined: 26 Feb 2009
Posts: 123

Another point worth checking is

If the topic "MONEY" is administratively defined (like via MQ Explorer), see if publishing on "MONEY" topic is inhibited.
Back to top
View user's profile Send private message
shashikanth_in
PostPosted: Thu Jul 16, 2009 9:51 am    Post subject: Reply with quote

Centurion

Joined: 26 Feb 2009
Posts: 123

shashikanth_in wrote:
MQRC 2051 is because you do not have Publish authority on topic "MONEY". Contact MQ Adminstrator to get you required authority on for your topic.

HTH


Sorry, my mistake.. if you don't have publish authority you will probably receive MQRC 2035 and not 2051.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Thu Jul 16, 2009 9:56 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9394
Location: US: west coast, almost. Otherwise, enroute.

Quote:
Script ended : Tue Jul 14 15:21:49 CDT 2009.


Quote:
07/16/09 10:08:20 - Process(1142940.66) User(mqm) Program(amqrmppa)
AMQ9209: Connection to host MSRT324 closed.


These dates/times are different. Is there an mq error log for the same date/time as the app error?
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
rakent
PostPosted: Tue Jun 17, 2014 9:13 am    Post subject: THANKS Reply with quote

Newbie

Joined: 28 Sep 2005
Posts: 7

Issue got fixed
Back to top
View user's profile Send private message
bruce2359
PostPosted: Tue Jun 17, 2014 9:27 am    Post subject: Re: THANKS Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9394
Location: US: west coast, almost. Otherwise, enroute.

rakent wrote:
Issue got fixed

For the benefit of all, please post the solution.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
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 » Issue while publishing in MQ V7
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.