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 » MQ connection, reason 2298

Post new topic  Reply to topic
 MQ connection, reason 2298 « View previous topic :: View next topic » 
Author Message
mqm-ser
PostPosted: Mon Feb 02, 2009 7:35 am    Post subject: MQ connection, reason 2298 Reply with quote

Newbie

Joined: 02 Feb 2009
Posts: 3

Hi, I'm new to MQ development...
I've been trying a simple connection to local MQ 7 on Linux... My code is as follows:

Code:

import com.ibm.mq.*;

public class MQSample {
public static void main(String args[]) {
      try {
         MQQueueManager qMgr = new MQQueueManager("QM1");
         int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT;
         MQQueue local_queue = qMgr.accessQueue("QL1", openOptions);
         MQMessage hello_world = new MQMessage();
         hello_world.writeUTF("Hello World!");
         MQPutMessageOptions pmo = new MQPutMessageOptions();
         local_queue.put(hello_world, pmo);
         MQMessage retrievedMessage = new MQMessage();
         retrievedMessage.messageId = hello_world.messageId;
         MQGetMessageOptions gmo = new MQGetMessageOptions();
         local_queue.get(retrievedMessage, gmo);
         String msgText = retrievedMessage.readUTF();
         System.out.println("The message is: " + msgText);
         local_queue.close();
         qMgr.disconnect();
      } catch (MQException ex) {
         System.out
               .println("A WebSphere MQ error occurred : Completion code "
                     + ex.completionCode + " Reason code "
                     + ex.reasonCode);
      } catch (java.io.IOException ex) {
         System.out.println("An error occurred whilst writing to the message buffer: "
                     + ex);
      }
   }
}



However, the only thing I get is:

MQJE001 Completion Code '2', Reason '2298'.
A WebSphere MQ error occurred Completion code 2 Reason code 2298

It saids it is 0x000008fa MQRC_FUNCTION_NOT_SUPPORTED

I suppose its a connection issue (MQQueueManager), but I'm not sure
Hope you can help me...
thanks
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Feb 02, 2009 7:42 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You don't want to use readUTF and writeUTF, those don't do what you think they do.

This has nothing to do with your 2298.

I suspect your 2298 is because you're trying to make a bindings connection on a machine that only has a client install...
Back to top
View user's profile Send private message
mqm-ser
PostPosted: Mon Feb 02, 2009 7:47 am    Post subject: Reply with quote

Newbie

Joined: 02 Feb 2009
Posts: 3

I'm not sure how to know if my installation is client or server, but as I understand, its a server installation, since I'm able to create queue managers and stuff...

Thanks for your suggestions about UTF, I'll fix it up...
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Feb 02, 2009 7:50 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Okay, if you're making a queue manager on the same machine, then it's definitely a server install.

You should scope your Try/Catch blocks to find out which MQ call is throwing the 2298 - the way it's written right now it could be any of them.

Or change your println of the exception to report the stacktrace so you can better find out what statement is throwing the exception.

Then you can reexamine your code and look in the documentation for reasons why that call might throw a 2298.
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 » MQ connection, reason 2298
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.