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 Java / JMS » JMS MQMessage problem

Post new topic  Reply to topic
 JMS MQMessage problem « View previous topic :: View next topic » 
Author Message
JavaRat
PostPosted: Tue Jun 24, 2008 11:27 pm    Post subject: JMS MQMessage problem Reply with quote

Newbie

Joined: 23 Jun 2008
Posts: 8

I have attempted to setup a simple javaprogram putting a textmessage onto a websphere queue (version 6) using the ibm class com.ibm.mq.*

I have successfully been able to put messages onto the websphere queue with a different approach code (http://www.mqseries.net/phpBB2/viewtopic.php?t=44052) but am now trying to do the same with MQMessage instead in hopes I will be able to set properties of the text which the MQwebsphere will accept.

The following error appears when trying to debug it (using the latest version of Eclipse).

Quote:
MQJE001: An MQException occurred: Completion Code 2, Reason 2009
MQJE016: MQ queue manager closed channel immediately during connect
Closure reason = 2009
MQJE001: An MQException occurred: Completion Code 2, Reason 2009
MQJE016: MQ queue manager closed channel immediately during connect
Closure reason = 2009


Code:

//MQMessagetest
String qManager = "Q01";                 
MQEnvironment.hostname = "100.100.100.100";     
MQEnvironment.channel  = "Q01.SENDQ.1";       
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,MQC.TRANSPORT_MQSERIES_CLIENT);

try {
MQQueueManager qMgr = new MQQueueManager(qManager);
int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT ;


//ERROR APPEARS HERE ------------------------------------
MQQueue system_default_local_queue = qMgr.accessQueue("Q01",openOptions);
// --------------------------------------------------------------

MQMessage hello_world = new MQMessage();
hello_world.writeUTF("Hello World!");
MQPutMessageOptions pmo = new MQPutMessageOptions(); 
system_default_local_queue.put(hello_world,pmo);
MQMessage retrievedMessage = new MQMessage();     
retrievedMessage.messageId = hello_world.messageId;
MQGetMessageOptions gmo = new MQGetMessageOptions();
system_default_local_queue.get(retrievedMessage, gmo);
String msgText = retrievedMessage.readUTF();
System.out.println("The message is: " + msgText);
system_default_local_queue.close();       
qMgr.disconnect();
}

catch (MQException ex){System.out.println("An MQSeries error occurred : Completion code " + ex.completionCode +  " Reason code " + ex.reasonCode); }    // Was it a Java buffer space error?   
catch (java.io.IOException ex){System.out.println("An error occurred whilst writing to the message buffer: " + ex);}
      


The exception appears when I step through
Quote:
MQQueue system_default_local_queue = qMgr.accessQueue("Q01",openOptions);



Any ideas where I am going wrong here?

/the JavaRat
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Jun 25, 2008 5:55 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Quote:

MQJE001: An MQException occurred: Completion Code 2, Reason 2009
MQJE016: MQ queue manager closed channel immediately during connect
Closure reason = 2009
MQJE001: An MQException occurred: Completion Code 2, Reason 2009
MQJE016: MQ queue manager closed channel immediately during connect
Closure reason = 2009

So did you search the forum for reason code 2009 and what did you find?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
JavaRat
PostPosted: Wed Jun 25, 2008 7:39 am    Post subject: Reply with quote

Newbie

Joined: 23 Jun 2008
Posts: 8

Thank you for your reply fjb_saper!
I have been browsing for the error code and come up with a lot of information. Securityissues, old jar-files, wrong setup websphere, incorrect input channelname,hostnames are a few of the problems.

Since I am able to put a message onto the queue with the code at:
http://www.mqseries.net/phpBB2/viewtopic.php?t=44052.
Therefor I currently suspect my setup is incorrect?

1. hostname = IPadress
2. channelname = "Q01.SENDQ.1" (incorrect syntax?)
3. port = 1414;
4. Properties.put (incorrect?)

Although another problem has arisen also:

Code:
MQQueueManager qMgr = new MQQueueManager("Q01");


is now producing the same error as of today???

MQJE001: An MQException occurred: Completion Code 2, Reason 2009
MQJE016: MQ queue manager closed channel immediately during connect
Closure reason = 2009
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Jun 25, 2008 7:59 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

The search button is your friend. Reason code 2009 has been document again and again in the forum.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
JavaRat
PostPosted: Fri Jun 27, 2008 3:07 am    Post subject: Reply with quote

Newbie

Joined: 23 Jun 2008
Posts: 8

The matter has been resolved at thread :
http://www.mqseries.net/phpBB2/viewtopic.php?t=44052 !
Therefore this test case is no longer needed and suspended for now. Thank you for your assistance in this matter fjb_saper there are definately a lot of threads to read up on around the matter 2009.
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 Java / JMS » JMS MQMessage problem
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.