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 » Cannot connect in "Client" mode from JMS to WMQ 7

Post new topic  Reply to topic Goto page 1, 2  Next
 Cannot connect in "Client" mode from JMS to WMQ 7 « View previous topic :: View next topic » 
Author Message
lyntongrice
PostPosted: Mon Sep 27, 2010 12:18 am    Post subject: Cannot connect in "Client" mode from JMS to WMQ 7 Reply with quote

Acolyte

Joined: 26 Sep 2010
Posts: 70

Hi there,

Can someone please tell me why I get the following error when trying to connect in "client mode" to my WMQ 7 installation?

NOTE: Before you see the error below here is the section of code with the Queue Manager etc specified (all entities below exist). Also NOTE that is I comment out the one line specifying the "WMQ_CM_CLIENT" below it WORKS,the moment I add it back in it fails.

Code:
JmsConnectionFactory cf = ff.createConnectionFactory();     
      cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, "127.0.0.1");
      cf.setIntProperty(WMQConstants.WMQ_PORT, 1414);
      cf.setStringProperty(WMQConstants.WMQ_CHANNEL, "SYSTEM.DEF.SVRCONN");     
      cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);
      cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, "QM_NC10");


And here is the error:

Code:

com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ0018: Failed to connect to queue manager 'QM_NC10' with connection mode 'Client' and host name '127.0.0.1'. Check the queue manager is started and if running in client mode, check there is a listener running. Please see the linked exception for more information.


The inner exception mentions things like:

Code:
com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2009' ('MQRC_CONNECTION_BROKEN').


And that the connection was rejected:

Code:
AMQ9204: Connection to host '127.0.0.1(1414)' rejected


This is blowing my mind as I do a CUSTOM install of WMQ 7.0 will all the client stuff etc, then even if I try run the "JMS samples" like "JMSProducer" I get the same error above.

I have tried setting up all the env vars like MQCHLLIB, MQCHLTAB and MQSERVER but nothing is helping.

Any advise would be greatly appreciated, thanks

Lynton
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Sep 27, 2010 1:17 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Did you start a listener on the qmgr? Is it actually on port 1414?
Back to top
View user's profile Send private message
lyntongrice
PostPosted: Mon Sep 27, 2010 1:33 am    Post subject: Reply with quote

Acolyte

Joined: 26 Sep 2010
Posts: 70

Hi there,

Yup...the listener is up on 1414....I can connect and send a message happily without the CLIENT mode specified....I would assume that means that 1414 is happy?

Thanks
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Sep 27, 2010 2:18 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

lyntongrice wrote:
Yup...the listener is up on 1414....


Good.
lyntongrice wrote:
I can connect and send a message happily without the CLIENT mode specified....I would assume that means that 1414 is happy?

Thanks


Nope. Bindings mode, the opposite of client mode, doesn't use the listener at all.

Can you telnet to 127.0.0.0(1414) from your machine? You do know that 127.0.0.0 is the loopback address and must always talk to the same computer, right? (I'm sure that you do, but one must still ask in absence of evidence to the contrary)
Back to top
View user's profile Send private message
zpat
PostPosted: Mon Sep 27, 2010 2:24 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

Connect a known working client program first such as MO71, or rfhutilc and ensure the QM can be connected to.
Back to top
View user's profile Send private message
lyntongrice
PostPosted: Mon Sep 27, 2010 3:30 am    Post subject: Reply with quote

Acolyte

Joined: 26 Sep 2010
Posts: 70

Hi there,

I am trying to connect from my laptop to the MQ server (also on my laptop) in client mode....that is the only reason I have "127.0.0.1"....I could also put in "localhost" or get the IP from IP config etc...but I was sure 127.0.0.1 would be fine?


I can run the "rfhutil.exe" fine....but when I try run "rfhutilc.exe" it just picks up the Queue Manager like the one defined in the Env Variable MQSERVER....but with no queues?

I can telnet to 127.0.0.1 1414

Could this be a firewall issue on my local machine?

I have run netstat -a

And I can see a:

TCP NC10:1414

But it does not say "LISTENING"?? What do I need to do to make it listen correctly?

If I look at the LISTENER.TCP it the Windows GUI for WMQ it says the status is "running" on port 1414?

Thanks for the help so far

Lynton
Back to top
View user's profile Send private message
zpat
PostPosted: Mon Sep 27, 2010 3:55 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

use the proper IP address, why make things hard for yourself?
Back to top
View user's profile Send private message
lyntongrice
PostPosted: Mon Sep 27, 2010 4:20 am    Post subject: Reply with quote

Acolyte

Joined: 26 Sep 2010
Posts: 70

Hi there,

I changed the config then to use 192.168.1.1 and I also changed the MQSERVER env variable but still the "rfhutilc.exe" will not load any queues.

I defined a client connection "SSL.CLIENTS" and a server connection channel called "SSL.CLIENTS".

The MQSERVER env variable is set to:

SSL.CLIENTS/TCP/192.168.1.1(1414)

I have tried a combination of the following....still no luck...

setmqaut -m <QMgr> -n RFHUTIL.REPLY.QUEUE** -t q +all
setmqaut -m <QMgr> -n SYSTEM.DEFAULT.MODEL.** -t q +all
setmqaut -m <QMgr> -n SYSTEM.ADMIN.COMMAND.QUEUE -t q +put

I cannot believe I am doing stuff that wrong?? Surely this should be easy easy?

Chat later, thanks so far...

Lynton
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Sep 27, 2010 4:31 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

I just had to make sure you weren't trying to talk to the MQServer on a machine that wasn't your laptop... As i said, I'm sure you did know what the loopback address was, but in absence of evidence I've found it sometimes necessary to *ask*.

The first and simplest thing to test is a plain straight telnet. You've said that works - you get a connection and a blank input prompt? If you type in text and hit enter, do you get errors in the AMQERR log?

You also need to setmqaut -m <qmgr> -t qmgr +all at least.

But if you were having a security issue, you'd be getting back a 2035 and not a 2009. The fact that you can do a telnet does a lot to eliminate a firewall, but your firewall could be playing tricky. So try turning it off temporarily?
Back to top
View user's profile Send private message
zpat
PostPosted: Mon Sep 27, 2010 4:33 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

For initial testing set the MCAUSER of your server connection channel to mqm (this is only to prove the connection).

Don't use SSL until non-SSL works. Check your MQ error log.
Back to top
View user's profile Send private message
lyntongrice
PostPosted: Mon Sep 27, 2010 4:48 am    Post subject: Reply with quote

Acolyte

Joined: 26 Sep 2010
Posts: 70

Hi there,

I added "mqm" to the MCAUSER in the server connection channel ....still no luck...

I also ran

setmqaut -m QM_NC10 -t qmgr +all

If I run a telnet to that IP and PORT it does bring up a blank screen as it should but the moment I type anything in it is dies and goes back to the command prompt.

Just checked, my firewall is actually off...

BTW: If I run "netstat -a" should I see the word "LISTENING" next to the 1414 port?

My one says:

Proto Local Address Foreign Address State
TCP NC10:1414 NC10:0 LISTENING

Does that look right? I see it has put my computer name (NC10) in there? Would that be ok?

I am getting these errors in the QMGR error logs:

Code:
----- amqccita.c : 1779 -------------------------------------------------------
2010/09/27 14:34:44 - Process(5092.5) User(MUSR_MQADMIN) Program(amqrmppa.exe)
AMQ9213: A communications error for TCP/IP occurred.

EXPLANATION:
An unexpected error occurred in communications.
ACTION:
The return code from the TCP/IP (ioctlsocket) call was 10038 (X'2736'). Record
these values and tell the systems administrator.
----- amqccita.c : 1779 -------------------------------------------------------


Any other ideas on what could be wrong?

Thanks again

Lynton
Back to top
View user's profile Send private message
lyntongrice
PostPosted: Mon Sep 27, 2010 4:50 am    Post subject: Reply with quote

Acolyte

Joined: 26 Sep 2010
Posts: 70

BTW: I do not have SSL turned on at all.....it is just a "confusing name", sorry. For the end result, yes, I will turn on SSL but for now I just want the MQ client to work ;-(
Back to top
View user's profile Send private message
lyntongrice
PostPosted: Mon Sep 27, 2010 5:07 am    Post subject: Reply with quote

Acolyte

Joined: 26 Sep 2010
Posts: 70

This is the error I get when I try connect from rfhutilc.exe...

Code:

2010/09/27 14:52:28 - Process(4828.1) User(lynton) Program(rfhutilc.exe)
AMQ9208: Error on receive from host 192.168.1.1.

EXPLANATION:
An error occurred receiving data from 192.168.1.1 over TCP/IP. This may be due
to a communications failure.
ACTION:
The return code from the TCP/IP (recv) call was 10054 (X'2746'). Record these
values and tell the systems administrator.
----- amqccita.c : 3336 -------------------------------------------------------


So it seems to hit the IP and PORT but then just dies immediatly...

Any ideas?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Sep 27, 2010 5:16 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

The 10038 is the correct error code for the MQ Listener when it doesn't receive MQ traffic, which you typing random characters into it's input stream is definitely not.

The use of your hostname in the netstat is okay and to be expected if you actually specified that in the MQ Listener object. It is otherwise okay as well if you did not specify -n on netstat (which, again, you didn't).

The 10054 is a different story, and is more likely a good start to a cause to your issue. That's WSAECONNRESET, and indicates that the mq listener *may* have dropped your rfhutil connection.

What does amqscnxc report?
Back to top
View user's profile Send private message
lyntongrice
PostPosted: Mon Sep 27, 2010 5:21 am    Post subject: Reply with quote

Acolyte

Joined: 26 Sep 2010
Posts: 70

Hi there,

I am not sure how to run "amqscnxc" so I just ran it as is from the command line

Code:

C:\Documents and Settings\lynton>amqscnxc
Sample AMQSCNXC start
Connecting to the default queue manager
with no client connection information specified.
MQCONNX ended with reason code 2538


I see 2538 is "MQRC_HOST_NOT_AVAILABLE"...

Let me know if I ran the program wrong? My environment variables are:

set MQCHLLIB=C:\MQClient\
set MQCHLTAB=AMQCLCHL.TAB
set MQSERVER=SSL.CLIENTS/TCP/192.168.1.1(1414)

This "host not available" is very irritating...;-( Thanks for your feedback so far, I really appreciate it...

Lynton
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » IBM MQ Java / JMS » Cannot connect in "Client" mode from JMS to WMQ 7
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.