|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
JMS Spring Adds Default Port to connection string... |
« View previous topic :: View next topic » |
Author |
Message
|
Jmeek |
Posted: Wed Dec 07, 2011 11:17 am Post subject: JMS Spring Adds Default Port to connection string... |
|
|
 Novice
Joined: 19 Dec 2005 Posts: 10 Location: Winston Salem, NC
|
Hey all, I am a JMS newbie and I'm trying to get the Multi-instance connection string to work. It works fine until it gets to the last host in the list. For some reason, it doesn't recognize that I'm using a different port and adds (1414) to the connection string...
Of Course, it bears mentioning, if I move the Multi-Instance queue manager to one of the other servers, OR, move the Hostname4(64308) to another position, it connects right up and sends the messages.
My connection string from the XML file looks like this...
<property name="hostName" value="Hostname1(64308),Hostname2(64308),Hostname3(64308),Hostname4(64308)"></property>
Please see Errors and where I highlighted the problem below...
[2011-12-06 22:54:43,140] INFO com.mq.poc.services.SpringJMSServiceImpl - [ENTER] com.mq.poc.services.MultiConnect_JMS_NoJNDIImpl.sendTextMessage()
[2011-12-06 22:54:43,140] INFO com.mq.poc.services.SpringJMSServiceImpl - [ENTER] com.mq.poc.services.MultiConnect_JMS_NoJNDIImpl.initialize()
[2011-12-06 22:54:43,140] DEBUG com.mq.poc.services.SpringJMSServiceImpl - Configuring mqQueueConnectionFactory...
[2011-12-06 22:54:43,140] INFO com.mq.poc.services.SpringJMSServiceImpl - [EXIT] com.mq.poc.services.MultiConnect_JMS_NoJNDIImpl.initialize()
[2011-12-06 22:54:43,140] DEBUG com.mq.poc.services.SpringJMSServiceImpl - obtaining a connection...
[2011-12-06 22:54:46,765] ERROR com.mq.poc.services.SpringJMSServiceImpl - ***** Message Delivery Failure: <MESSAGE>null</MESSAGE>
com.ibm.msg.client.jms.DetailedIllegalStateException: JMSWMQ0018: Failed to connect to queue manager 'TESTQM1' with connection mode 'Client' and host name 'Hostname3.subdom.com(64308),Hostname2.subdom.com(64308),Hostname1.subdom.com(64308),Hostname4.subdom.com(64308)(1414)'. 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.
at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:496)
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:236)
at com.ibm.msg.client.wmq.internal.WMQConnection.<init>(WMQConnection.java:451)
at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:7188)
at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:6579)
at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:295)
at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6232)
at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:115)
at com.mq.poc.services.MultiConnect_JMS_NoJNDIImpl.sendTextMessage(MultiConnect_JMS_NoJNDIImpl.java:65)
at com.mq.poc.MQ4UTester.sendMessages(MQ4UTester.java:43)
at com.mq.poc.MQ4UTester.main(MQ4UTester.java:5
Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2059' ('MQRC_Q_MGR_NOT_AVAILABLE').
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:223)
... 9 more
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2059;AMQ9204: Connection to host 'Hostname4.subdom.com(64308)(1414)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2059;AMQ9205: The host name supplied is not valid. [3=Hostname3.subdom.com(64308),4=TCP]],3=Hostname4.subdom.com(64308)(1414),5=RemoteTCPConnection.parseConnectionName]
at com.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiConnect(RemoteFAP.java:2019)
at com.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiConnect(RemoteFAP.java:1233)
at com.ibm.msg.client.wmq.internal.WMQConnection.<init>(WMQConnection.java:366)
... 8 more
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2059;AMQ9204: Connection to host 'Hostname1.subdom.com(64308)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2059;AMQ9213: A communications error for occurred. [1=java.net.ConnectException[Connection refused: connect],3=Hostname1.subdom.com]],3=Hostname1.subdom.com(64308),5=RemoteTCPConnection.connnectUsingLocalAddress]
... 11 more
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2059;AMQ9204: Connection to host 'Hostname2.subdom.com(64308)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2059;AMQ9213: A communications error for occurred. [1=java.net.ConnectException[Connection refused: connect],3=Hostname2.subdom.com]],3=Hostname2.subdom.com(64308),5=RemoteTCPConnection.connnectUsingLocalAddress]
... 11 more
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2059;AMQ9204: Connection to host 'Hostname3.subdom.com(64308)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2059;AMQ9213: A communications error for occurred. [1=java.net.ConnectException[Connection refused: connect],3=Hostname3.subdom.com]],3=Hostname3.subdom.com(64308),5=RemoteTCPConnection.connnectUsingLocalAddress]
... 11 more
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2059;AMQ9213: A communications error for occurred. [1=java.net.ConnectException[Connection refused: connect],3=Hostname3.subdom.com]
at com.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.connnectUsingLocalAddress(RemoteTCPConnection.java:667)
at com.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:995)
at com.ibm.mq.jmqi.remote.internal.system.RemoteConnection.connect(RemoteConnection.java:1154)
at com.ibm.mq.jmqi.remote.internal.system.RemoteConnectionPool.getConnection(RemoteConnectionPool.java:353)
at com.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiConnect(RemoteFAP.java:1607)
... 10 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at com.ibm.mq.jmqi.remote.internal.RemoteTCPConnection$5.run(RemoteTCPConnection.java:654)
at java.security.AccessController.doPrivileged(Native Method)
at com.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.connnectUsingLocalAddress(RemoteTCPConnection.java:647)
... 14 more
[2011-12-06 22:54:46,765] DEBUG com.mq.poc.services.SpringJMSServiceImpl - cleaning up connection and session objects...
[2011-12-06 22:54:46,765] INFO com.mq.poc.services.SpringJMSServiceImpl - [EXIT] com.mq.poc.services.MultiConnect_JMS_NoJNDIImpl.sendTextMessage(), which took 0 milliseconds (average = 0 milliseconds per message)
[2011-12-06 22:54:46,765] INFO com.mq.poc.MQ4UTester - [EXIT] com.mq.poc.services.MQ4UTester.sendMessages() _________________ All else fails, RTFM. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Dec 07, 2011 11:35 am Post subject: Re: JMS Spring Adds Default Port to connection string... |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Jmeek wrote: |
Of Course, it bears mentioning, if I move the Multi-Instance queue manager to one of the other servers, OR, move the Hostname4(64308) to another position, it connects right up and sends the messages. |
Please provide further detail on this.
The original issue suggests that you just need to remove the port # from the hostname list and put it in the port number directly.
But the fact that "the same" configuration works on other machines or with partial hostnames in different places, means that the problem is something else entirely. |
|
Back to top |
|
 |
Jmeek |
Posted: Wed Dec 07, 2011 1:16 pm Post subject: |
|
|
 Novice
Joined: 19 Dec 2005 Posts: 10 Location: Winston Salem, NC
|
Right, I can get it to work... The problem is that the JMS code seems to recognize the port for all the hosts in the list, but Adds the default port at the end of the string for the last host in the string.
Hostname4.subdom.com(64308)(1414)
If it can connect on any of the previous hosts, it obviously wouldn't continue down the list. _________________ All else fails, RTFM. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Dec 07, 2011 2:16 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Jmeek wrote: |
Right, I can get it to work... The problem is that the JMS code seems to recognize the port for all the hosts in the list, but Adds the default port at the end of the string for the last host in the string.
Hostname4.subdom.com(64308)(1414)
If it can connect on any of the previous hosts, it obviously wouldn't continue down the list. |
Right, okay.
That suggests that it's not treating this list of names as a list of names that includes a port #, and is always including the port# at the end. I.e. it's not treating it as a list of names, but merely a single hostname.
Try adding multiple
Code: |
<property name="hostName" value="hostname1"></property> |
tags, and then set the portNo property to 64308. |
|
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
|
|
|
|