2 Replies Latest reply on Dec 10, 2009 3:18 AM by Thomas Chang

    java.net.BindException: Address already in use

    Thomas Chang Apprentice

      I deleted a platform from inventory. I try to rediscover it and do as discribed in FAQ document by starting the /rhg-agent.sh -l. But I got exception after I've entered the parameters.

      ...
      [vger1@s001c1201 bin]$ ./rhq-agent.sh -s
      RHQ 1.3.0.GA [5192] (Thu Sep 17 18:17:28 CEST 2009)
      Answer the following questions to setup this RHQ Agent instance.
      - After each prompt, a default value will appear in square brackets.
       If you press the ENTER key without providing any value,
       the new preference value will be set to that default value.
      - If you wish to rely on the system internal default value and
       not define any preference value, enter '!*'.
      - If you wish to stop before finishing all the questions but still
       retain those preferences you already set, enter '!+'.
      - If you wish to cancel before finishing all the questions and revert
       all preferences back to their original values, enter '!-'.
      - If you need help for a particular preference, enter '!?'.
      
      Agent Name [s001c1201.ad001.proactiv.grp] : s001ap26-prod.agent.vger1
      Agent Hostname or IP Address [!*] : 130.144.164.162
      Agent Port [16163] :
      RHQ Server Hostname or IP Address [127.0.0.1] : 130.144.163.128
      RHQ Server Port [7080] :
      The setup has been completed for the preferences at node [/rhq-agent/default].
      Failed to start the agent
      java.net.BindException: Address already in use
      ...
      


      In log by JON-Server I see followings:
      ...
      2009-12-09 08:56:22,607 WARN [org.rhq.enterprise.communications.command.server.CommandProcessor] {CommandProcessor.failed-authentication}Command failed to be authenticated! This command will be ignored and not processed: Command: type=[remotepojo]; cmd-in-response=[false]; config=[{rhq.agent-name=s001ap26-prod.agent.vger1, rhq.externalizable-strategy=AGENT, rhq.send-throttle=true, rhq.guaranteed-delivery=true}]; params=[{invocation=NameBasedInvocation[mergeMeasurementReport], targetInterfaceName=org.rhq.core.clientapi.server.measurement.MeasurementServerService}]
      ...
      


      What's the problem?

        • 1. Re: java.net.BindException: Address already in use
          Ian Springer Master

           

          java.net.BindException: Address already in use


          This most likely means the Agent was unable to bind to 130.144.164.162:16163 because another process is already bound to that address (probably another Agent process that you previously started). Try using ps to look for another Agent java process. If you find one, kill it. If not, use lsof to figure out what process is listening on 16163, and then kill it. Then try starting your Agent again with -l.


          • 2. Re: java.net.BindException: Address already in use
            Thomas Chang Apprentice

             

            "ips" wrote:
            java.net.BindException: Address already in use


            This most likely means the Agent was unable to bind to 130.144.164.162:16163 because another process is already bound to that address (probably another Agent process that you previously started). Try using ps to look for another Agent java process. If you find one, kill it. If not, use lsof to figure out what process is listening on 16163, and then kill it. Then try starting your Agent again with -l.


            You are right. I did the same yesterday as you said here. The deleted Agent is still running. I stop it and I can register it again.