<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
Can't create control connection
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/ron.sigal%40jboss.com">Ron Sigal</a> in <i>JBoss Remoting</i> - <a href="http://community.jboss.org/message/545225#545225">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p><span style="font-family: Arial; font-size: 10pt;">Nguyen Dang Quang asks:<br/></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><div><span style="font-family: Arial; font-size: 10pt;">I'm using the jboss  SocketServerInvoker for start multi Servers jboss for my  project.</span></div><div> </div><div><span style="font-family: Arial; font-size: 10pt;">For now, It works on  two server run concurrency. But when I start the thirst server, it through error  like that:</span></div><div> </div><blockquote class="jive-quote" dir="ltr" style="margin-right: 0px;"><div><span style="font-family: Arial; font-size: 10pt;">org.jboss.jms.exception.MessagingNetworkFailureException<br/> at    org.jboss.jms.client.delegate.DelegateSupport.handleThrowable(DelegateSupport.java:250)<br/> at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$createConnectionDelegate$aop(ClientConnectionFactoryDelegate.java:191)<br/> at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeTarget(ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)<br/> at    org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)<br/> at    org.jboss.jms.client.container.StateCreationAspect.handleCreateConnectionDelegate(StateCreationAspect.java:81)<br/> at org.jboss.aop.advice.org.jboss.jms.client.container.StateCreationAspect_z_handleCreateConnectionDelegate_15210920.invoke(StateCreationAspect_z_handleCreateConnectionDelegate_15210920.java)<br/> at    org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)<br/> at    org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.createConnectionDelegate(ClientConnectionFactoryDelegate.java)<br/> at    org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:205)<br/> at    org.jboss.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:87)<br/> at org.jboss.messaging.core.impl.clusterconnection.ClusterConnectionManager$ConnectionInfo.start(ClusterConnectionManager.java:646)<br/> at org.jboss.messaging.core.impl.clusterconnection.ClusterConnectionManager.ensureAllConnectionsCreated(ClusterConnectionManager.java:409)<br/> at    org.jboss.messaging.core.impl.clusterconnection.ClusterConnectionManager.notify(ClusterConnectionManager.java:230)<br/> at    org.jboss.messaging.core.impl.DefaultClusterNotifier.sendNotification(DefaultClusterNotifier.java:72)<br/> at    org.jboss.messaging.core.impl.postoffice.MessagingPostOffice.putReplicantLocally(MessagingPostOffice.java:1244)<br/> at    org.jboss.messaging.core.impl.postoffice.PutReplicantRequest.execute(PutReplicantRequest.java:94)<br/> at    org.jboss.messaging.core.impl.postoffice.GroupMember$ControlRequestHandler.handle(GroupMember.java:622)<br/> at    org.jgroups.blocks.MessageDispatcher.handle(MessageDispatcher.java:616)<br/> at    org.jgroups.blocks.RequestCorrelator.handleRequest(RequestCorrelator.java:637)<br/> at    org.jgroups.blocks.RequestCorrelator$Request.run(RequestCorrelator.java:944)<br/> at    org.jgroups.util.ReusableThread.run(ReusableThread.java:220)<br/> at    java.lang.Thread.run(Thread.java:619)<br/>Caused by: java.io.IOException:    Cannot find matching home for control connection<br/> at    org.jboss.remoting.transport.bisocket.BisocketServerInvoker.createControlConnection(BisocketServerInvoker.java:376)<br/> at    org.jboss.remoting.transport.bisocket.BisocketClientInvoker.transport(BisocketClientInvoker.java:415)<br/> at    org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:165)<br/> at    org.jboss.remoting.Client.invoke(Client.java:1724)<br/> at    org.jboss.remoting.Client.addCallbackListener(Client.java:1793)<br/> at    org.jboss.remoting.Client.addListener(Client.java:1001)<br/> at    org.jboss.jms.client.remoting.JMSRemotingConnection.addInvokerCallbackHandler(JMSRemotingConnection.java:259)<br/> at    org.jboss.jms.client.remoting.JMSRemotingConnection.start(JMSRemotingConnection.java:375)<br/> at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$createConnectionDelegate$aop(ClientConnectionFactoryDelegate.java:158)<br/> ...    20 more<br/></span></div></blockquote><div><span style="font-family: Arial; font-size: 10pt;">I see the code where  it fault:</span></div><div> </div><blockquote class="jive-quote" dir="ltr" style="margin-right: 0px;"><div><span style="font-family: Arial; font-size: 10pt;">// If a server    restarts, it is likely that it creates a new secondary server socket    on<br/>      // a different port.  It will    possible to recreate the control connection, but    if<br/>      // there is no PingTimerTask running in    the new server to keep it alive, it will    just<br/>      // die again.  Once a new    secondary server socket address is detected, a count is    kept<br/>      // of the number of times the control    connection is restarted, and when it hits a<br/>         // configured maximum, it is allowed to die.  See    JBREM-731.<br/>         <br/>      boolean locatorChanged =    !newLocator.equals(oldLocator);<br/>         listenerIdToInvokerLocatorMap.put(listenerId,    newLocator);<br/>         <br/>      String host =    newLocator.getHost();<br/>      int port =    newLocator.getPort();<br/>      if    (newLocator.isMultihome())<br/>         {<br/>         host =    clientInvoker.getHomeInUse().host;<br/>            port = -1;<br/>         Iterator it =    null;<br/>         if    (newLocator.getConnectHomeList().isEmpty())<br/>               it =     newLocator.getHomeList().iterator();<br/>            else<br/>            it    =    newLocator.getConnectHomeList().iterator();<br/>            <br/>         while    (it.hasNext())<br/>            {<br/>            Home h    = (Home)    it.next();<br/>               if    (host.equals(h.host))<br/>               {<br/>                  port =    h.port;<br/>                  newLocator.setHomeInUse(h);<br/>                  break;<br/>               }<br/>            }<br/>      }<br/>         <br/>      if (port ==    -1)<br/>         {<br/>         <strong>throw new    IOException("Cannot find matching home for control    connection");<br/></strong>      }</span></div><div align="left"> </div><div align="left"> </div></blockquote><div align="left"><span style="font-family: Arial; font-size: 10pt;">I don't  know why it return port == -1 and get to error here?</span></div><div align="left"><span style="font-family: Arial; font-size: 10pt;">Could you  please help me to clarify this error. Thans for your  suggest!</span></div></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/545225#545225">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Remoting at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2050">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>