|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
connecting to a remote MQSeries server |
« View previous topic :: View next topic » |
Author |
Message
|
hrishi |
Posted: Mon May 22, 2006 7:09 pm Post subject: connecting to a remote MQSeries server |
|
|
Newbie
Joined: 27 Apr 2006 Posts: 5
|
Hi All,
I am using MQ for the first time and am facing some problems:
i have written a small java code tht creates a Connection, using MQ JMS API. I am using the server IP address, port number on which QM is running, and the Queue Manager name to connect to the QM.
When i run the code on the server where the MQSeries is running, it connects properly. But when i run it on another client machine, it gives the following exception:
javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for 'QM_TEST'
at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:586)
at com.ibm.mq.jms.MQConnection.createQM(MQConnection.java:2110)
at com.ibm.mq.jms.MQConnection.createQMNonXA(MQConnection.java:1532)
at com.ibm.mq.jms.MQTopicConnection.<init>(MQTopicConnection.java:224)
at com.ibm.mq.jms.MQTopicConnection.<init>(MQTopicConnection.java:92)
at com.ibm.mq.jms.MQTopicConnectionFactory.createMQTopicConnection(MQTopicConnectionFactory.java:354)
at com.ibm.mq.jms.MQTopicConnectionFactory.createMQTopicConnection(MQTopicConnectionFactory.java:302)
at com.ibm.mq.jms.MQTopicConnectionFactory.createTopicConnection(MQTopicConnectionFactory.java:198)
So i wish to know:
>Is it required for an application connecting to a remote MQSeries server to use a login/password to connect to the server? if yes, how is tht done?
>Is it required to install some MQ clinet on the client machine for running an application using MQ JMS API?
or am i doing it all wrong?
Any inputs on the same would be highly appreciated...
Thanks a ton, in advance...
hrishi |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon May 22, 2006 7:42 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Using JMS from the app server to communicate to MQ remotely set up an alias for JAAS authentication. Then on the definition of the qcf/tcf use the alias as container authentication.... This should do it.
In standalone JMS you will have to pass the userid and passed as you access the qmgr and create the connection.
ex qcf.createConnection(uname, passwd);
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
hrishi |
Posted: Mon May 22, 2006 11:11 pm Post subject: |
|
|
Newbie
Joined: 27 Apr 2006 Posts: 5
|
Thanks, fjb_saper!!
Looks like I have another problem as well:
>>The client machine on which I am trying to run the java code also has MQSeries server running on it. So when I try to connect to the remote QM,.. it actually connects to the QM running on the local machine. (This I found out when I changed the name of QM to one on the local machine)… The code is not attempting to connect to the remote QM.
I wish to know why this happens.
>>Also, If I have to connect from a machine without any MQ installation, I get the error meassage that required libraries and .dll’s are not available. How can I find out what all .dll’s and libraries need to be copied? Or do I have to have some MQ installation on the client machine as well.
My code looks like this (It is a standalone app ):
Code: |
try
{
QueueConnectionFactory conFactory = new MQQueueConnectionFactory();
((MQQueueConnectionFactory)conFactory).setChannel("SYSTEM.DEF.SVRCONN");
((MQQueueConnectionFactory)conFactory).setHostName("192.168.251.132");
((MQQueueConnectionFactory)conFactory).setPort(1414);
((MQQueueConnectionFactory)conFactory).setQueueManager("QM_TEST");
System.out.println("setters done...");
QueueConnection connection = conFactory.createQueueConnection("Administrator","password");
System.out.println("got TopicConnection");
}
catch(Exception e)
{
e.printStackTrace();
} |
Please do give ur inputs on this…
Thanks in advance,
Hrishi |
|
Back to top |
|
 |
lohitashwa |
Posted: Tue May 23, 2006 12:42 am Post subject: |
|
|
Newbie
Joined: 05 May 2005 Posts: 5
|
Hi,
Its a bit confusing with the stack trace and the sample code you have pasted, the code snippet shows that you are making use of QueueConnectionFactory, whereas the StackTrace shows using TopicConnection. I think this is a mis-match. Kindly confirm???
From the code snippet, you are specifying the hostname, port, channel and the queue manager name, but you are not setting the transport type to "CLIENT",
((MQQueueConnectionFactory)conFactory).setTransportType(1);
// 0 = BINDING MODE and 1 = CLIENT Mode
If the application does not set the above trasport type property then the application tries to connect to the queue manager in the BINDING's mode, so set this value and check if the problem gets resolved when connecting to a different machine on which the queue manager resides.
Regards
Lohitashwa T |
|
Back to top |
|
 |
hrishi |
Posted: Tue May 23, 2006 9:51 pm Post subject: |
|
|
Newbie
Joined: 27 Apr 2006 Posts: 5
|
Hey Lohitashwa,
Thanks!!
Ooppsss … yes, the stack trace was frm another similar code whr I had used TopicConnection. Sorry for the mismatch…
setting the transport type made the code work.
Thanks, Lohitashwa and fjb_saper!
cheers,
hrishi |
|
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
|
|
|
|