Author |
Message
|
shabata |
Posted: Mon Oct 17, 2005 6:28 am Post subject: Failure in connecting to a remote queue manager (2059) |
|
|
Newbie
Joined: 17 Oct 2005 Posts: 7
|
Hi !
Here is the environment of my problem :
COMPUTER1 : MQServer v.6 with 2 queue managers
- QM_FRAISE :
x Remote queue Q2
x Transmission queue QM_KIWI
x Sender Channel QM_FRAISE.QM_KIWI
! Connection name = COMP001(1416)
! Transmission Queue = QM_KIWI
x Server Connection Channel CLIENT.QM_FRAISE
x Listener.tcp port=1417
- QM_KIWI :
x Local queue Q2
x Receiver Channel QM_FRAISE.QM_KIWI
x Listener.tcp port=1416
COMPUTER2 : MQClient v.6 with Environment Variable "MQSERVER" sets to "CLIENT.QM_FRAISE/TCP/COMP001 (1417)"
I based this environment using Websphere MQ tutorial "Sending a message using a client/server configuration"
Using command line or WebsphereMQ Explorer, it works well when I try to send a message from Computer2 to queue "Q2" (the message is received in queue manager QM_KIWI)
I'm trying to do the same using JAVA (with IBM API com.ibm.mq.jar), but I don't manage to make it working !
Here is my java code :
Code: |
int openOptions = MQC.MQOO_OUTPUT;
MQEnvironment.hostname= "COMP001";
MQEnvironment.port = 1417;
MQEnvironment.channel = "CLIENT.QM_FRAISE";
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);
MQQueueManager qmgr= new MQQueueManager("QM_FRAISE");
MQQueue q = qmgr.accessQueue("Q2", openOptions);
|
It returns a 2059 MQException on "new MQQueueManager()"
Please help. I've been reading so many posts and web sites, in vane...
Thanx a lot for your help |
|
Back to top |
|
 |
RogerLacroix |
Posted: Mon Oct 17, 2005 8:15 pm Post subject: Re: Failure in connecting to a remote queue manager (2059) |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
shabata wrote: |
I'm trying to do the same using JAVA (with IBM API com.ibm.mq.jar), but I don't manage to make it working ! |
Are you saying you have only 1 MQ jar file in your CLASSPATH ?? If so, please read the manual because you are missing some jar files.
Regards,
Roger Lacroix _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
shabata |
Posted: Tue Oct 18, 2005 12:06 am Post subject: |
|
|
Newbie
Joined: 17 Oct 2005 Posts: 7
|
Thank you for your reply.
Which manual are you talking about ?
From what I've read, I need only the package com.ibm.mq.* which is provided by the jar com.ibm.mq.jar.
I don't have any errors of class-path or missing classes, therefore I think I don't need any other jar files. Don't you think so ?
Any other ideas ? |
|
Back to top |
|
 |
EddieA |
Posted: Tue Oct 18, 2005 8:44 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Quote: |
Which manual are you talking about |
Using Java. (For V6: SC34-6591-00).
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
shabata |
Posted: Wed Oct 19, 2005 11:41 pm Post subject: Re: Failure in connecting to a remote queue manager (2059) |
|
|
Newbie
Joined: 17 Oct 2005 Posts: 7
|
RogerLacroix wrote: |
shabata wrote: |
I'm trying to do the same using JAVA (with IBM API com.ibm.mq.jar), but I don't manage to make it working ! |
Are you saying you have only 1 MQ jar file in your CLASSPATH ?? If so, please read the manual because you are missing some jar files.
Regards,
Roger Lacroix |
Can u tell me which jar you are using ? I have no clue of what I need to make my stuff work, and I'm still stuck with a MQException code 2059 . |
|
Back to top |
|
 |
Mr Butcher |
Posted: Thu Oct 20, 2005 12:07 am Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
did you had a look in the manual? even i - and i am not a java guru - find the sample classpath with a view mouseclicks, and i am recognizing there is not only one jar file in the classpath.
are you shanta's teammate? _________________ Regards, Butcher |
|
Back to top |
|
 |
shabata |
Posted: Thu Oct 20, 2005 3:33 am Post subject: |
|
|
Newbie
Joined: 17 Oct 2005 Posts: 7
|
thanx for trying to help me.
Actually it's now working, but it was not a JAR problem.
The problem was about MQEnvironment : I was setting hostname, port number, and channel both in MQEnvironment and MQEnvironment.properties.
And when I set these attributes only in MQEnvironment, it's working.
I can now put messages from a client to a server with Java.
Right now, I've got another problem : getting messages from the server. I don't understand why I have the following exception : "2045 unable to open the queue for input". |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Oct 20, 2005 3:34 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You can't GET from anything other than a qlocal. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
shabata |
Posted: Thu Oct 20, 2005 4:29 am Post subject: |
|
|
Newbie
Joined: 17 Oct 2005 Posts: 7
|
jefflowrey wrote: |
You can't GET from anything other than a qlocal. |
so how do u make a client getting messages from a queue on a server ? |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Oct 20, 2005 4:33 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
shabata wrote: |
jefflowrey wrote: |
You can't GET from anything other than a qlocal. |
so how do u make a client getting messages from a queue on a server ? |
A client gets from qlocals. A server app gets from qlocals.
A client puts to any kind of q. A server app puts to any kind of q. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
shabata |
Posted: Thu Oct 20, 2005 4:50 am Post subject: |
|
|
Newbie
Joined: 17 Oct 2005 Posts: 7
|
jefflowrey wrote: |
A client gets from qlocals. A server app gets from qlocals. |
Thanx for your answer, but I still don't understand how to make it work.
With the environment describes above, I can put messages like this :
But when I write
, it says I can't open the queue for Input.
How should I configure my client&server environment to be able to do it ?
Should I create another channel ? or a local queue ? Should I modifiy my MQSERVER variable ?
Thank you for your help |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Oct 20, 2005 5:04 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Let me try again.
An application can only issue a GET against a queue that is of type QLOCAL on the queue manager the application is connected to.
You can not issue GETS against QRemotes, or QClusters, or QAliases that point to QRemotes or QClusters.
Therefore, if your application needs to GET from a queue, it must be a QLOCAL on the queue manager the application is connected to.
How you choose to ensure that the queues that your applications need to get from are QLOCALS on the queue managers those applications are connected to is entirely up to you. THere are many different ways to handle it, based on many many different factors.
Good Luck.
Also, did it occur to you that the documentation might have a Guide for Programming Applications, that would help you? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
shabata |
Posted: Thu Oct 20, 2005 5:58 am Post subject: |
|
|
Newbie
Joined: 17 Oct 2005 Posts: 7
|
jefflowrey wrote: |
Let me try again. |
Thanx again
jefflowrey wrote: |
An application can only issue a GET against a queue that is of type QLOCAL on the queue manager the application is connected to. |
All right, I understand that.
But from what you said, does it mean that using this following environment :
there's no way to get messages of queue Q2 from the Client and via QM_FRAISE ?
If there's a way, I would appreciate that you tell me which one.
jefflowrey wrote: |
Also, did it occur to you that the documentation might have a Guide for Programming Applications, that would help you? |
I did read this guide... |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Oct 20, 2005 6:04 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
shabata wrote: |
there's no way to get messages of queue Q2 from the Client and via QM_FRAISE ? |
That's correct. Not via QM_FRAISE. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|