<!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;">&#160;</p><div><span style="font-family: Arial; font-size: 10pt;">I'm using the jboss&#160; SocketServerInvoker for start multi Servers jboss for my&#160; project.</span></div><div> </div><div><span style="font-family: Arial; font-size: 10pt;">For now, It works on&#160; two server run concurrency. But when I start the thirst server, it through error&#160; 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&#160;&#160;&#160; 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&#160;&#160;&#160; org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)<br/> at&#160;&#160;&#160; 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&#160;&#160;&#160; org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)<br/> at&#160;&#160;&#160; org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.createConnectionDelegate(ClientConnectionFactoryDelegate.java)<br/> at&#160;&#160;&#160; org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:205)<br/> at&#160;&#160;&#160; 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&#160;&#160;&#160; org.jboss.messaging.core.impl.clusterconnection.ClusterConnectionManager.notify(ClusterConnectionManager.java:230)<br/> at&#160;&#160;&#160; org.jboss.messaging.core.impl.DefaultClusterNotifier.sendNotification(DefaultClusterNotifier.java:72)<br/> at&#160;&#160;&#160; org.jboss.messaging.core.impl.postoffice.MessagingPostOffice.putReplicantLocally(MessagingPostOffice.java:1244)<br/> at&#160;&#160;&#160; org.jboss.messaging.core.impl.postoffice.PutReplicantRequest.execute(PutReplicantRequest.java:94)<br/> at&#160;&#160;&#160; org.jboss.messaging.core.impl.postoffice.GroupMember$ControlRequestHandler.handle(GroupMember.java:622)<br/> at&#160;&#160;&#160; org.jgroups.blocks.MessageDispatcher.handle(MessageDispatcher.java:616)<br/> at&#160;&#160;&#160; org.jgroups.blocks.RequestCorrelator.handleRequest(RequestCorrelator.java:637)<br/> at&#160;&#160;&#160; org.jgroups.blocks.RequestCorrelator$Request.run(RequestCorrelator.java:944)<br/> at&#160;&#160;&#160; org.jgroups.util.ReusableThread.run(ReusableThread.java:220)<br/> at&#160;&#160;&#160; java.lang.Thread.run(Thread.java:619)<br/>Caused by: java.io.IOException:&#160;&#160;&#160; Cannot find matching home for control connection<br/> at&#160;&#160;&#160; org.jboss.remoting.transport.bisocket.BisocketServerInvoker.createControlConnection(BisocketServerInvoker.java:376)<br/> at&#160;&#160;&#160; org.jboss.remoting.transport.bisocket.BisocketClientInvoker.transport(BisocketClientInvoker.java:415)<br/> at&#160;&#160;&#160; org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:165)<br/> at&#160;&#160;&#160; org.jboss.remoting.Client.invoke(Client.java:1724)<br/> at&#160;&#160;&#160; org.jboss.remoting.Client.addCallbackListener(Client.java:1793)<br/> at&#160;&#160;&#160; org.jboss.remoting.Client.addListener(Client.java:1001)<br/> at&#160;&#160;&#160; org.jboss.jms.client.remoting.JMSRemotingConnection.addInvokerCallbackHandler(JMSRemotingConnection.java:259)<br/> at&#160;&#160;&#160; 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/> ...&#160;&#160;&#160; 20 more<br/></span></div></blockquote><div><span style="font-family: Arial; font-size: 10pt;">I see the code where&#160; 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&#160;&#160;&#160; restarts, it is likely that it creates a new secondary server socket&#160;&#160;&#160; on<br/>&#160;&#160;&#160;&#160;&#160; // a different port.&#160; It will&#160;&#160;&#160; possible to recreate the control connection, but&#160;&#160;&#160; if<br/>&#160;&#160;&#160;&#160;&#160; // there is no PingTimerTask running in&#160;&#160;&#160; the new server to keep it alive, it will&#160;&#160;&#160; just<br/>&#160;&#160;&#160;&#160;&#160; // die again.&#160; Once a new&#160;&#160;&#160; secondary server socket address is detected, a count is&#160;&#160;&#160; kept<br/>&#160;&#160;&#160;&#160;&#160; // of the number of times the control&#160;&#160;&#160; connection is restarted, and when it hits a<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // configured maximum, it is allowed to die.&#160; See&#160;&#160;&#160; JBREM-731.<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br/>&#160;&#160;&#160;&#160;&#160; boolean locatorChanged =&#160;&#160;&#160; !newLocator.equals(oldLocator);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; listenerIdToInvokerLocatorMap.put(listenerId,&#160;&#160;&#160; newLocator);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br/>&#160;&#160;&#160;&#160;&#160; String host =&#160;&#160;&#160; newLocator.getHost();<br/>&#160;&#160;&#160;&#160;&#160; int port =&#160;&#160;&#160; newLocator.getPort();<br/>&#160;&#160;&#160;&#160;&#160; if&#160;&#160;&#160; (newLocator.isMultihome())<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; host =&#160;&#160;&#160; clientInvoker.getHomeInUse().host;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; port = -1;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Iterator it =&#160;&#160;&#160; null;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if&#160;&#160;&#160; (newLocator.getConnectHomeList().isEmpty())<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; it =&#160;&#160;&#160;&#160; newLocator.getHomeList().iterator();<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; else<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; it&#160;&#160;&#160; =&#160;&#160;&#160; newLocator.getConnectHomeList().iterator();<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; while&#160;&#160;&#160; (it.hasNext())<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Home h&#160;&#160;&#160; = (Home)&#160;&#160;&#160; it.next();<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if&#160;&#160;&#160; (host.equals(h.host))<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; port =&#160;&#160;&#160; h.port;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; newLocator.setHomeInUse(h);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br/>&#160;&#160;&#160;&#160;&#160; }<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br/>&#160;&#160;&#160;&#160;&#160; if (port ==&#160;&#160;&#160; -1)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <strong>throw new&#160;&#160;&#160; IOException("Cannot find matching home for control&#160;&#160;&#160; connection");<br/></strong>&#160;&#160;&#160;&#160;&#160; }</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&#160; 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&#160; please help me to clarify this error. Thans for your&#160; 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>