Author |
Message
|
rakent |
Posted: Tue Jul 14, 2009 12:26 pm Post subject: Issue while publishing in MQ V7 |
|
|
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 |
|
 |
bruce2359 |
Posted: Tue Jul 14, 2009 12:39 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 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 |
|
 |
rakent |
Posted: Wed Jul 15, 2009 6:13 am Post subject: |
|
|
Newbie
Joined: 28 Sep 2005 Posts: 7
|
$ mqrc 2051
2051 0x00000803 MQRC_PUT_INHIBITED
mqm@mw95tst1 [/usr/java5/bin] |
|
Back to top |
|
 |
bruce2359 |
Posted: Wed Jul 15, 2009 6:31 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 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 |
|
 |
shashikanth_in |
Posted: Wed Jul 15, 2009 8:13 pm Post subject: |
|
|
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 |
|
 |
rakent |
Posted: Thu Jul 16, 2009 6:13 am Post subject: |
|
|
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 |
|
 |
bruce2359 |
Posted: Thu Jul 16, 2009 6:15 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 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 |
|
 |
rakent |
Posted: Thu Jul 16, 2009 6:40 am Post subject: |
|
|
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 |
|
 |
bruce2359 |
Posted: Thu Jul 16, 2009 6:54 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 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 |
|
 |
rakent |
Posted: Thu Jul 16, 2009 7:09 am Post subject: |
|
|
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 |
|
 |
shashikanth_in |
Posted: Thu Jul 16, 2009 9:49 am Post subject: |
|
|
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 |
|
 |
shashikanth_in |
Posted: Thu Jul 16, 2009 9:51 am Post subject: |
|
|
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 |
|
 |
bruce2359 |
Posted: Thu Jul 16, 2009 9:56 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 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 |
|
 |
rakent |
Posted: Tue Jun 17, 2014 9:13 am Post subject: THANKS |
|
|
Newbie
Joined: 28 Sep 2005 Posts: 7
|
|
Back to top |
|
 |
bruce2359 |
Posted: Tue Jun 17, 2014 9:27 am Post subject: Re: THANKS |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 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 |
|
 |
|