|  | 
 
  
    | RSS Feed - WebSphere MQ Support | RSS Feed - Message Broker Support |  
 
  
	|    |  |  
  
	| problem in MQQueManagerConstructor....urgent | « View previous topic :: View next topic » |  
  	| 
		
		
		  | Author | Message |  
		  | amigupta1978 | 
			  
				|  Posted: Mon Feb 25, 2002 5:03 pm    Post subject: |   |  |  
		  | Centurion
 
 
 Joined: 22 Jan 2002Posts: 132
 Location: India
 
 | 
			  
				| Hello, I am using MQ v5.2 on AIX 4.3.3 with JDK version "J2RE 1.3.0 IBM build ca130-20010925". My MQJava classes are at version 5.2.0. When I am issuing MQQuemanager qm= new MQQueueManager  ("Default qmgr") I am getting the following error Reason code 2059(cut and pasted the error below)..but when I was using JDK 1.8.8 on this machine everything was working fine. Can any one pls help me how to solve this prob.
 
 Thnx in advance,
 Regards,
 Amit
 
 Error is ..
 Exception in thread "main" com.ibm.mq.MQException: MQJE001: Completion Code 2, R
 eason 2059 at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:166) at com.ibm.mq.MQBindingsManagedConnectionFactoryJ11._createManagedConnec
 tion(MQBindingsManagedConnectionFactoryJ11.java:136)
 at com.ibm.mq.MQBindingsManagedConnectionFactoryJ11.createManagedConnect
 ion(MQBindingsManagedConnectionFactoryJ11.java:154)
 at com.ibm.mq.StoredManagedConnection.<init>(StoredManagedConnection.jav
 a:80)
 at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConne
 ctionManager.java:150)
 at com.ibm.mq.MQQueueManager.obtainBaseMQQueueManager(MQQueueManager.jav
 a:560)
 at com.ibm.mq.MQQueueManager.construct(MQQueueManager.java:509)
 at com.ibm.mq.MQQueueManager.<init>(MQQueueManager.java:286)
 at ReadQ.main(ReadQ.java:14)
 |  |  
		  | Back to top |  |  
		  |  |  
		  | kolban | 
			  
				|  Posted: Tue Feb 26, 2002 7:09 am    Post subject: |   |  |  
		  |  Grand Master
 
 
 Joined: 22 May 2001Posts: 1072
 Location: Fort Worth, TX, USA
 
 | 
			  
				| Can you post the code that makes the calls?  I am thinking (a guess here) that your queue manager is remote to your application and you haven't set your MQEnvironment properties correctly. |  |  
		  | Back to top |  |  
		  |  |  
		  | StefanSievert | 
			  
				|  Posted: Tue Feb 26, 2002 10:53 am    Post subject: |   |  |  
		  |  Partisan
 
 
 Joined: 28 Oct 2001Posts: 333
 Location: San Francisco
 
 |  |  
		  | Back to top |  |  
		  |  |  
		  | amigupta1978 | 
			  
				|  Posted: Tue Feb 26, 2002 12:17 pm    Post subject: |   |  |  
		  | Centurion
 
 
 Joined: 22 Jan 2002Posts: 132
 Location: India
 
 | 
			  
				| hi, thnx for the replies.
 
 I just checked my Queue manager and seen that it was not default so I just use the "SYSTEM.ADMIN.SVRCONN" channel to connect..
 
 and thanks Stefan for pointing me to that documentation. Its really helpful for me if I get in some troubles further.(actually I know while working in my previous project with jdk1.2.2 we have to export one variable before we can connect to MQseries using the MQJava)
 
 But one thing still I am unable to understand that the code I am attaching was working in JDK 1.8.8 (i.e without using the MQEnvironment.channel option) but not in JDK 1.3
 
 and one more question out of this is that If I am connecting while using the MQEnvironmeent.channel option then I am connecting as MQSeries client then in that case I think I will not be able to do any MQegin call I suppose. Pls clarify on this too.
 
 Anyway thnx for the help.
 
 Regards,
 Amit
 
 
 import java.util.*;
 import com.ibm.mq.*;
 public class  ReadQ
 {
 
 public static void main(String[] args) throws Exception
 {
 
 MQQueueManager _queueManager = null;
 String qManager = "Queuemanagername";
 String inputQName=args[0];
 _queueManager = new MQQueueManager(qManager);
 int openOptions = MQC.MQOO_INQUIRE + MQC.MQOO_FAIL_IF_QUIESCING + MQC.MQOO_INPUT_SHARED + MQC.MQOO_BROWSE ;
 MQQueue queue = _queueManager.accessQueue( inputQName,
 openOptions,
 null,           // default q manager
 null,           // no dynamic q name
 null );         // no alternate user id
 int depth = queue.getCurrentDepth();
 
 if (depth == 0)
 {
 System.out.println("Current depth: " + depth + "n");
 return ;
 }
 
 MQGetMessageOptions getOptions = new MQGetMessageOptions();
 getOptions.matchOptions = MQC.MQMO_NONE;
 
 MQMessage message = new MQMessage();
 queue.get(message, getOptions);
 byte[] b = new byte[message.getMessageLength()];
 message.readFully(b);
 String msg=new String(b);
 System.out.println(msg);
 queue.close();
 _queueManager.disconnect();
 
 }
 }
 
 |  |  
		  | Back to top |  |  
		  |  |  
		  | PeterPotkay | 
			  
				|  Posted: Tue Feb 26, 2002 12:40 pm    Post subject: |   |  |  
		  |  Poobah
 
 
 Joined: 15 May 2001Posts: 7723
 
 
 | 
			  
				| It is whether you specify the hostname or not that determines whether you are a client or not (Hostname specified = Client). And yes, if you are a client, you cannot use the MQBegin API call. 
 
 _________________
 Peter Potkay
 Keep Calm and MQ On
 |  |  
		  | Back to top |  |  
		  |  |  
		  |  |  |  
  
	|    |  | Page 1 of 1 |  
 
 
  
  	| 
		
		  | 
 
 | 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
 
 |  |  |  |