1 Reply Latest reply on May 27, 2010 9:03 PM by Ron Sigal

    Can't create control connection

    Ron Sigal Master

      Nguyen Dang Quang asks:

       

      I'm using the jboss  SocketServerInvoker for start multi Servers jboss for my  project.
      For now, It works on  two server run concurrency. But when I start the thirst server, it through error  like that:
      org.jboss.jms.exception.MessagingNetworkFailureException
      at    org.jboss.jms.client.delegate.DelegateSupport.handleThrowable(DelegateSupport.java:250)
      at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$createConnectionDelegate$aop(ClientConnectionFactoryDelegate.java:191)
      at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeTarget(ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
      at    org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
      at    org.jboss.jms.client.container.StateCreationAspect.handleCreateConnectionDelegate(StateCreationAspect.java:81)
      at org.jboss.aop.advice.org.jboss.jms.client.container.StateCreationAspect_z_handleCreateConnectionDelegate_15210920.invoke(StateCreationAspect_z_handleCreateConnectionDelegate_15210920.java)
      at    org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at    org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.createConnectionDelegate(ClientConnectionFactoryDelegate.java)
      at    org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:205)
      at    org.jboss.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:87)
      at org.jboss.messaging.core.impl.clusterconnection.ClusterConnectionManager$ConnectionInfo.start(ClusterConnectionManager.java:646)
      at org.jboss.messaging.core.impl.clusterconnection.ClusterConnectionManager.ensureAllConnectionsCreated(ClusterConnectionManager.java:409)
      at    org.jboss.messaging.core.impl.clusterconnection.ClusterConnectionManager.notify(ClusterConnectionManager.java:230)
      at    org.jboss.messaging.core.impl.DefaultClusterNotifier.sendNotification(DefaultClusterNotifier.java:72)
      at    org.jboss.messaging.core.impl.postoffice.MessagingPostOffice.putReplicantLocally(MessagingPostOffice.java:1244)
      at    org.jboss.messaging.core.impl.postoffice.PutReplicantRequest.execute(PutReplicantRequest.java:94)
      at    org.jboss.messaging.core.impl.postoffice.GroupMember$ControlRequestHandler.handle(GroupMember.java:622)
      at    org.jgroups.blocks.MessageDispatcher.handle(MessageDispatcher.java:616)
      at    org.jgroups.blocks.RequestCorrelator.handleRequest(RequestCorrelator.java:637)
      at    org.jgroups.blocks.RequestCorrelator$Request.run(RequestCorrelator.java:944)
      at    org.jgroups.util.ReusableThread.run(ReusableThread.java:220)
      at    java.lang.Thread.run(Thread.java:619)
      Caused by: java.io.IOException:    Cannot find matching home for control connection
      at    org.jboss.remoting.transport.bisocket.BisocketServerInvoker.createControlConnection(BisocketServerInvoker.java:376)
      at    org.jboss.remoting.transport.bisocket.BisocketClientInvoker.transport(BisocketClientInvoker.java:415)
      at    org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:165)
      at    org.jboss.remoting.Client.invoke(Client.java:1724)
      at    org.jboss.remoting.Client.addCallbackListener(Client.java:1793)
      at    org.jboss.remoting.Client.addListener(Client.java:1001)
      at    org.jboss.jms.client.remoting.JMSRemotingConnection.addInvokerCallbackHandler(JMSRemotingConnection.java:259)
      at    org.jboss.jms.client.remoting.JMSRemotingConnection.start(JMSRemotingConnection.java:375)
      at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$createConnectionDelegate$aop(ClientConnectionFactoryDelegate.java:158)
      ...    20 more
      I see the code where  it fault:
      // If a server    restarts, it is likely that it creates a new secondary server socket    on
            // a different port.  It will    possible to recreate the control connection, but    if
            // there is no PingTimerTask running in    the new server to keep it alive, it will    just
            // die again.  Once a new    secondary server socket address is detected, a count is    kept
            // of the number of times the control    connection is restarted, and when it hits a
               // configured maximum, it is allowed to die.  See    JBREM-731.
              
            boolean locatorChanged =    !newLocator.equals(oldLocator);
               listenerIdToInvokerLocatorMap.put(listenerId,    newLocator);
              
            String host =    newLocator.getHost();
            int port =    newLocator.getPort();
            if    (newLocator.isMultihome())
               {
               host =    clientInvoker.getHomeInUse().host;
                  port = -1;
               Iterator it =    null;
               if    (newLocator.getConnectHomeList().isEmpty())
                     it =     newLocator.getHomeList().iterator();
                  else
                  it    =    newLocator.getConnectHomeList().iterator();
                 
               while    (it.hasNext())
                  {
                  Home h    = (Home)    it.next();
                     if    (host.equals(h.host))
                     {
                        port =    h.port;
                        newLocator.setHomeInUse(h);
                        break;
                     }
                  }
            }
              
            if (port ==    -1)
               {
               throw new    IOException("Cannot find matching home for control    connection");
            }
      I don't  know why it return port == -1 and get to error here?
      Could you  please help me to clarify this error. Thans for your  suggest!