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 » problem in MQQueManagerConstructor....urgent

Post new topic  Reply to topic
 problem in MQQueManagerConstructor....urgent « View previous topic :: View next topic » 
Author Message
amigupta1978
PostPosted: Mon Feb 25, 2002 5:03 pm    Post subject: Reply with quote

Centurion

Joined: 22 Jan 2002
Posts: 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
View user's profile Send private message Send e-mail Yahoo Messenger
kolban
PostPosted: Tue Feb 26, 2002 7:09 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2001
Posts: 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
View user's profile Send private message
StefanSievert
PostPosted: Tue Feb 26, 2002 10:53 am    Post subject: Reply with quote

Partisan

Joined: 28 Oct 2001
Posts: 333
Location: San Francisco

Hi,
I don't know if this is the same problem, but it sounds similar.
http://www-4.ibm.com/software/ts/mqseries/support/summary/javasupp.html#AIX
Maybe it's worth to give it a try, especially if it has worked with your previous JDK.
Stefan

_________________
Stefan Sievert
IBM Certified * WebSphere MQ
Back to top
View user's profile Send private message
amigupta1978
PostPosted: Tue Feb 26, 2002 12:17 pm    Post subject: Reply with quote

Centurion

Joined: 22 Jan 2002
Posts: 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
View user's profile Send private message Send e-mail Yahoo Messenger
PeterPotkay
PostPosted: Tue Feb 26, 2002 12:40 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7717

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
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 » problem in MQQueManagerConstructor....urgent
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.