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 » can you tell the mistake in this code

Post new topic  Reply to topic
 can you tell the mistake in this code « View previous topic :: View next topic » 
Author Message
kattics
PostPosted: Thu Mar 09, 2006 11:57 am    Post subject: can you tell the mistake in this code Reply with quote

Novice

Joined: 08 Feb 2006
Posts: 19

Hi!

I was trying to get connection to the remote MQseries server having Queues and Queue managers.I am getting these errors.

My code:

******************************
import com.ibm.mq.jms.MQQueueConnectionFactory;
import com.ibm.mq.jms.JMSC;

import javax.jms.QueueConnection;
import javax.jms.QueueSession;
import javax.jms.Session;
import javax.jms.Queue;
import javax.jms.QueueReceiver;
import javax.jms.QueueSender;
import javax.jms.TextMessage;
import javax.jms.JMSException;

import java.util.Date;
public class example
{


public static void main(String args[])throws javax.jms.JMSException
{

MQQueueConnectionFactory factory = null;
QueueConnection connection = null;
QueueSession session = null;
Queue Q = null;
QueueReceiver receiver = null;
QueueSender sender = null;

factory = new MQQueueConnectionFactory();
factory.setTransportType( JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
factory.setQueueManager( "TEST.QMGR");
factory.setHostName( "160.130.20.30" );
factory.setPort(22000 );
factory.setChannel("TEST.SERVER");
connection = factory.createQueueConnection();
System.out.println("success");

****************************************************

errors:
Exception in thread "main" javax.jms.JMSException: MQJMS2005: failed to create M
QQueueManager for 160.130.20.30:TEST.QMGR'
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Mar 09, 2006 12:01 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Yes.

You are failing to capture and print the linked exception which holds the MQ Reason Code that tells you why it's not working.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
kattics
PostPosted: Thu Mar 09, 2006 12:03 pm    Post subject: Reply with quote

Novice

Joined: 08 Feb 2006
Posts: 19

Hi Jeffrey!

Can u elaborate ur statement. I am new to java and MQseries
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Mar 09, 2006 12:11 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Being new to something means that you should be actively learning.

That can mean "asking questions". But it should also mean "trying to find answers on your own".

There is a lovely little button near the top of this page that is labeled 'Search'.
_________________
I am *not* the model of the modern major general.
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 » can you tell the mistake in this code
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.