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 » MQClient Connection MQJMS2005

Post new topic  Reply to topic
 MQClient Connection MQJMS2005 « View previous topic :: View next topic » 
Author Message
Vin
PostPosted: Tue Mar 11, 2003 3:11 pm    Post subject: MQClient Connection MQJMS2005 Reply with quote

Master

Joined: 25 Mar 2002
Posts: 212
Location: India

I'm using MQClient Connection and trying to connect to a remote queue manager and was getting the following error.

JMS Exception: javax.jms.JMSException: MQJMS2005: failed to create MQQueueManage
r for 'localhost:SSPQM'
Linked exception: com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 20
59

Does anyone have any clue? my remote queue manager is running and the listener is also running for that QueueManager.

Thanks for all the help.
Back to top
View user's profile Send private message
vennela
PostPosted: Tue Mar 11, 2003 4:42 pm    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

Your queue manager definition is not correct I guess.
Are you using JNDI to define objects

If you are using JNDI to define objects then make sure that you give all the values for the connection factory
like qmgr, channel trasport(which is client in your case) port host

I am saying this because your program is looking for 'localhost:SSPQM'.

More information is needed to tell what exactly is going wrong.

-------
Venny
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Vin
PostPosted: Tue Mar 11, 2003 5:27 pm    Post subject: Reply with quote

Master

Joined: 25 Mar 2002
Posts: 212
Location: India

Thanks for the reply. I did set everything and inspite of that it's giving me this error. I also defined a Server Connection channel and a Client Connection channel on the QueueManager QM_svinjamurlpt. For the Host name I had tried using both IP Address as well as name, nothing worked.
Appreciate your help.



private MQQueueConnectionFactory registerMQQueueConnFactory(InitialContext context)
throws JMSException, NamingException {

// Retrieve MQ Connection Factory JNDI Name.
String connFactoryJNDIName =
(String) SSPEnv.getInstance()
.get(SSPConstants.MQ_QUEUE_CONN_FACTORY_JNDI_NAME);

// Create MQ Queue Connection Factory
MQQueueConnectionFactory connFactory = new MQQueueConnectionFactory();
connFactory.setChannel("chan1");

// Configurable parameters are expected to be given by SSPEnv
// rather than coming from Weblogic Configuration XML.
// Idea is to minimize the stuff that goes into Weblogic XML and centralize
// all the configuration with xmls that were fed to SSPEnv, so that
// maintenance is easy.
String mqHost =
(String) SSPEnv.getInstance().get(SSPConstants.MQ_QM_HOST_PROPERTY);

String mqPort =
(String) SSPEnv.getInstance().get(SSPConstants.MQ_QM_PORT_PROPERTY);

System.out.println("QueueManagerHost: " + mqHost +" QueueManagerPort: " + mqPort);

if (mqHost == null) {
connFactory.setTransportType(JMSC.MQJMS_TP_BINDINGS_MQ);
connFactory.setHostName("svinjamurlpt");//mqHost);

if (mqPort != null) {
try {
int portNum = Integer.parseInt(mqPort);
connFactory.setPort(1414);//portNum);
}
catch (NumberFormatException ignore) {
// Log the warning here..
}
}
}
else {
connFactory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
}

// Set the Queue Manager for Conn Factory.
String qmName =
(String) SSPEnv.getInstance().get(SSPConstants.MQ_QUEUE_MANAGER_NAME);

connFactory.setQueueManager(qmName);

// Register connection factory
context.bind(connFactoryJNDIName, connFactory);

return connFactory;
}
Back to top
View user's profile Send private message
Vin
PostPosted: Tue Mar 11, 2003 5:36 pm    Post subject: Reply with quote

Master

Joined: 25 Mar 2002
Posts: 212
Location: India

I get this new exception now. Can anyone suggest a fix to this?
Thanks.

JMS Exception: javax.jms.JMSException: MQJMS2005: failed to create MQQueueManage
r for '143.91.70.127:QM_svinjamurlpt'
Linked exception: com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 20
09
Back to top
View user's profile Send private message
vennela
PostPosted: Tue Mar 11, 2003 9:33 pm    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

Is chan1 a svconn channel. I would suggest you use SYSTEM.DEF.SVRCONN initially.

-------
Venny
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bower5932
PostPosted: Wed Mar 12, 2003 6:18 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

If you are running MQ 5.2, make sure that you have at least CSD4 installed.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Vin
PostPosted: Wed Mar 12, 2003 7:36 am    Post subject: Reply with quote

Master

Joined: 25 Mar 2002
Posts: 212
Location: India

chan1 is a sever connection channel and I have defined an environment variable on the client side as suggested by the IBM manual
set MQServer=chan1/TCP/ServerAddress(port).

I'm using MQSeries 5.3. I get this after trying to run my cleint. The Strange thing though is that when I try to do the amqsputc from the client machine everything seems to be working fine. But through the Java program I have this problem. Any clue?
Back to top
View user's profile Send private message
vennela
PostPosted: Wed Mar 12, 2003 8:20 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

Can you try this program.
Call it MQClientPut.java

Replace QMGR name, Hostname only. Replace port if the listener is not running on 1414 otherwise leave it.

Code:
import com.ibm.mq.*;
public class MQClientPut extends Object {

    /** Creates new MQPut */
    public MQClientPut() {
    }

    /**
     * @param args the command line arguments
     */
    public static void main (String args[]) {

        try {

            String QM1 = "SSPQM";
            String QUEUE1 = "SYSTEM.DEFAULT.LOCAL.QUEUE";

            System.out.println("Starting MQClientPut Program: ");
            MQEnvironment.hostname = "svinjamurlpt";
            MQEnvironment.channel  = "SYSTEM.DEF.SVRCONN";
            MQEnvironment.port     = 1414;
            MQQueueManager qmgr = new MQQueueManager(QM1 ) ;
           
            System.out.println("Connected to QMGR " + QM1);

            int openOptions = MQC.MQOO_OUTPUT;
            MQQueue InQueue = qmgr.accessQueue(QUEUE1 , openOptions, null, null, null);
            MQMessage inMessage = new MQMessage();
            inMessage.writeString("What is your name");
            InQueue.put(inMessage);
            System.out.println("Message Id is :" + inMessage.messageId);
            InQueue.close();
            qmgr.disconnect() ;

        }
        catch(MQException ex){
            System.out.println("MQ Error - Reason code :" + ex.reasonCode);
        }
        catch (Exception e){
            System.out.println("Error : " + e);
        }

    }

}


-------
Venny
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Vin
PostPosted: Wed Mar 12, 2003 8:58 am    Post subject: Reply with quote

Master

Joined: 25 Mar 2002
Posts: 212
Location: India

I ran this program and it gave me the following error.

MQJE001: Completion Code 2, Reason 2059
MQError - Reason Code: 2059

It also says Socket Connection attempt refused.

Does that give you any clue?

Thanks.
Back to top
View user's profile Send private message
vennela
PostPosted: Wed Mar 12, 2003 9:13 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

Is your QMGR running. Is there a listener running.

Once you get those two up, see if the program works. If it does then change it and give the channel name "chan1", the one you have defined and see how it goes.

-------
Venny
Back to top
View user's profile Send private message Send e-mail Visit poster's website
lol
PostPosted: Tue Oct 07, 2003 9:40 am    Post subject: Problem with remote Q put Reply with quote

Newbie

Joined: 07 Oct 2003
Posts: 2

I have MQ server running on a red-hat linux ver 8. So far I have created

1. Qmgr "QM"
2. A local TX Queue
3. A sender Channel "A.TO.B"
4. A remote Q with XMITQ set to the TX Q

The channel is connected to the other end with another QManager thru a rev channel.

I have started up my QM, Channel, and a listener.

When I run this java program with the supplied QM, Channel, and Q name
I get error MQ Error 2009 with completion code 2.
What am I doing wrong ?
Back to top
View user's profile Send private message
lol
PostPosted: Tue Oct 07, 2003 9:44 am    Post subject: Reply with quote

Newbie

Joined: 07 Oct 2003
Posts: 2

Sorry, this is the java program

import com.ibm.mq.*;
public class MQClientPut extends Object {

/** Creates new MQPut */
public MQClientPut() {
}

/**
* @param args the command line arguments
*/
public static void main (String args[]) {

try {

String QM1 = "BDEDEV01.BDEQM";
String QUEUE1 = "EDICTT.TEST.BDE.EVENTQ";

System.out.println("Starting MQClientPut Program: ");
MQEnvironment.hostname = "10.255.7.1";
MQEnvironment.channel = "BDEDEV01.TO.MQ1P";
MQEnvironment.port = 1414;
MQQueueManager qmgr = new MQQueueManager(QM1 ) ;

System.out.println("Connected to QMGR " + QM1);

int openOptions = MQC.MQOO_OUTPUT;
MQQueue InQueue = qmgr.accessQueue(QUEUE1 , openOptions, null, null, null);
MQMessage inMessage = new MQMessage();
inMessage.writeString("4A3000000520030930;OCT06/2003;13:24:53;RCV;OCT06/2003;06:26:40;000123547;DDS EdictA-FTP;");
InQueue.put(inMessage);
System.out.println("Message Id is :" + inMessage.messageId);
InQueue.close();
qmgr.disconnect() ;

}
catch(MQException ex){
System.out.println("MQ Error - Reason code :" + ex.reasonCode);
ex.printStackTrace();
}
catch (Exception e){
System.out.println("Error : " + e);
e.printStackTrace();
}

}

}

Also, using MQSeries version 5.1
Back to top
View user's profile Send private message
bower5932
PostPosted: Tue Oct 07, 2003 11:11 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

You are running MQ 5.1 on Linux? This could be all of your problem. I thought that Linux java support came later, and it is entirely possible that enough changed/didn't change that you won't get connected. Bring your MQ up to a supported level and see what it does.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » MQClient Connection MQJMS2005
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.