HornetQNotConnectedException[errorType=NOT_CONNECTED message=HQ119007: Cannot connect to server(s)]
zhfeng Feb 10, 2015 9:54 AMHi all,
We had met this issue when running the CI tests. I had checked the log files and it looks like the client lost the connection. see the following
2014-11-19 21:38:59,625 WARN [org.hornetq.core.client] (hornetq-failure-check-thread) HQ212037: Connection failure has been detected: HQ119014: Did not receive data from invm:0. It is likely the client has exited or crashed without closing its connection, or the network between the server and client has failed. You also might have configured connection-ttl and client-failure-check-period incorrectly. Please check user manual for more information. The connection will now be closed. [code=CONNECTION_TIMEDOUT]
2014-11-19 21:38:59,626 TRACE [org.hornetq.core.server] (hornetq-failure-check-thread) Connection removed 78dbd32a-7034-11e4-8c19-61c30e379d43 from server HornetQServerImpl::serverUUID=98490d2c-7031-11e4-8c19-61c30e379d43: java.lang.Exception: trace
at org.hornetq.core.remoting.server.impl.RemotingServiceImpl.connectionDestroyed(RemotingServiceImpl.java:554)
at org.hornetq.core.remoting.impl.invm.InVMAcceptor$Listener.connectionDestroyed(InVMAcceptor.java:278)
at org.hornetq.core.remoting.impl.invm.InVMConnection.close(InVMConnection.java:118)
at org.hornetq.core.protocol.core.impl.RemotingConnectionImpl.internalClose(RemotingConnectionImpl.java:619)
at org.hornetq.core.protocol.core.impl.RemotingConnectionImpl.fail(RemotingConnectionImpl.java:354)
at org.hornetq.core.remoting.server.impl.RemotingServiceImpl$FailureCheckAndFlushThread.run(RemotingServiceImpl.java:765)
2014-11-19 21:38:59,626 INFO [org.hornetq.core.server] (hornetq-failure-check-thread) HQ221021: failed to remove connection
2014-11-19 21:38:59,627 TRACE [org.hornetq.core.client] (StompConnect Transport: tcp:///127.0.0.1:60851) ClientSessionFactoryImpl [serverLocator=ServerLocatorImpl [initialConnectors=[TransportConfiguration(name=in-vm, factory=org-hornetq-core-remoting-impl-invm-InVMConnectorFactory) ?server-id=0], discoveryGroupConfiguration=null], connectorConfig=TransportConfiguration(name=787e49d8-7034-11e4-8c19-61c30e379d43, factory=org-hornetq-core-remoting-impl-invm-InVMConnectorFactory) ?server-id=0, backupConfig=null]::Subscribing Topology
2014-11-19 21:38:59,627 TRACE [org.hornetq.core.client] (Thread-14 (HornetQ-client-global-threads-20087331)) Client Connection failed, calling failure listeners and trying to reconnect, reconnectAttempts=0
2014-11-19 21:38:59,627 TRACE [org.hornetq.core.client] (StompConnect Transport: tcp:///127.0.0.1:60851) Sending packet nonblocking SubscribeClusterTopologyUpdatesMessage [clusterConnection=false, toString()=PACKET(SubscribeClusterTopologyUpdatesMessageV2)[type=113, channelID=0, packetObject=SubscribeClusterTopologyUpdatesMessageV2]] on channeID=0
2014-11-19 21:38:59,627 TRACE [org.hornetq.core.client] (StompConnect Transport: tcp:///127.0.0.1:60851) Writing buffer for channelID=0
2014-11-19 21:38:59,627 TRACE [org.hornetq.core.server] (Thread-9 (HornetQ-remoting-threads-HornetQServerImpl::serverUUID=98490d2c-7031-11e4-8c19-61c30e379d43-25631302-13495423)) InVMConnection [serverID=0, id=78dbd32a-7034-11e4-8c19-61c30e379d43]::packet sent done
2014-11-19 21:38:59,627 TRACE [org.hornetq.core.client] (StompConnect Transport: tcp:///127.0.0.1:60851) returning null
2014-11-19 21:38:59,628 DEBUG [org.hornetq.core.client] (StompConnect Transport: tcp:///127.0.0.1:60851) Trying to connect towards ClientSessionFactoryImpl [serverLocator=ServerLocatorImpl [initialConnectors=[TransportConfiguration(name=in-vm, factory=org-hornetq-core-remoting-impl-invm-InVMConnectorFactory) ?server-id=0], discoveryGroupConfiguration=null], connectorConfig=TransportConfiguration(name=787e49d8-7034-11e4-8c19-61c30e379d43, factory=org-hornetq-core-remoting-impl-invm-InVMConnectorFactory) ?server-id=0, backupConfig=null]
2014-11-19 21:38:59,629 DEBUG [org.codehaus.stomp.jms.ProtocolConverter] (StompConnect Transport: tcp:///127.0.0.1:60851) Caught an exception: : javax.jms.JMSException: Failed to create session factory
at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:673)
at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:112)
at org.codehaus.stomp.jms.ProtocolConverter.onStompConnect(ProtocolConverter.java:229)
at org.codehaus.stomp.jms.ProtocolConverter.onStompFrame(ProtocolConverter.java:182)
at org.codehaus.stomp.tcp.TcpTransport.run(TcpTransport.java:101)
at java.lang.Thread.run(Thread.java:744)
Caused by: HornetQNotConnectedException[errorType=NOT_CONNECTED message=HQ119007: Cannot connect to server(s). Tried with all available servers.]
at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:901)
at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:669)
... 5 more
It looks very strange and I wonder how this issue could happened.
We use the default setting in the wildfly configuration.
<jms-connection-factories> <connection-factory name="InVmConnectionFactory"> <connectors> <connector-ref connector-name="in-vm"/> </connectors> <entries> <entry name="java:/ConnectionFactory"/> </entries> <client-failure-check-period>86400000</client-failure-check-period> <connection-ttl>-1</connection-ttl> </connection-factory> <connection-factory name="RemoteConnectionFactory"> <connectors> <connector-ref connector-name="http-connector"/> </connectors> <entries> <entry name="java:jboss/exported/jms/RemoteConnectionFactory"/> </entries> </connection-factory> <pooled-connection-factory name="hornetq-ra"> <transaction mode="xa"/> <connectors> <connector-ref connector-name="in-vm"/> </connectors> <entries> <entry name="java:/JmsXA"/> <entry name="java:jboss/DefaultJMSConnectionFactory"/> </entries> <client-failure-check-period>86400000</client-failure-check-period> <connection-ttl>-1</connection-ttl> </pooled-connection-factory> </jms-connection-factories>
I just want to know if it would be helpful by setting the <reconnect-attempts> ?
Thanks in any suggestion and feedback !
Amos