5 Replies Latest reply on Dec 1, 2003 8:58 PM by tgilley42

    java.net.BindException:  Address already in use

    tgilley42 Newbie

      Hi all, I am attempting to boot two different server instances within jboss-3.2.2, and I am receiving an address already in use error trying to boot the second server instance. The error log also states that it "cannot instantiate trap session." Does anyone know what the trap session is? I verified all of the ports are different between my two server instances. Do you have any thoughts on what else I can check? It is not clear to me from the log which address is already in use. Each instance will boot successfully when it is the first instance booted. Which-ever instance I boot second will always get the error shown below.

      Thanks for any insights you can share with me.


      2003-12-01 18:43:17,455 INFO [org.jboss.deployment.SARDeployer] nested deployment: file:/opt/apps/jboss/jboss-3.2.2/server/idev1
      a/deploy/snmp-adaptor.sar/castor.jar
      2003-12-01 18:43:19,674 ERROR [org.jboss.jmx.adaptor.snmp.trapd.TrapdService] Cannot instantiate trap session
      2003-12-01 18:43:19,682 ERROR [org.jboss.jmx.adaptor.snmp.trapd.TrapdService] Starting failed
      java.net.BindException: Address already in use
      at java.net.PlainDatagramSocketImpl.bind(Native Method)
      at java.net.DatagramSocket.bind(DatagramSocket.java:368)
      at java.net.DatagramSocket.(DatagramSocket.java:210)
      at java.net.DatagramSocket.(DatagramSocket.java:261)
      at java.net.DatagramSocket.(DatagramSocket.java:234)
      at org.opennms.protocols.snmp.SnmpPortal.(SnmpPortal.java:159)
      at org.opennms.protocols.snmp.SnmpTrapSession.(SnmpTrapSession.java:312)
      at org.jboss.jmx.adaptor.snmp.trapd.TrapdService.startService(TrapdService.java:92)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
      at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)
      at $Proxy14.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:394)
      at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy4.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:226)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:642)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy6.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:302)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:476)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:201)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:274)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
      at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)

        • 1. Re: java.net.BindException:  Address already in use
          Jon Barnett Master

          JBoss 3.2.2 introduces an SNMP service so you can monitor the health of JBoss via HP OpenView or similar. You probably have not changed the SNMP service port as set in JBOSS_HOME/server/default/deploy/snmp-adaptor.sar/META-INF/jboss-service.xml or whatever represents your run-time instance - here it is the default run-time instance.

          Alternatively you could remove the SNMP adaptor from your configuration.

          • 2. Re: java.net.BindException:  Address already in use
            tgilley42 Newbie


            I figured it out. There is a port within the standard default install ( /deploy/snmp-adaptor.sar/jboss-service.xml ) that I didn't see before. Once I modified that one I got past the error below.

            Now, I'm looking to resolve this one: Does anyone know where the jboss.mq:service=InvocationLayer is?


            2003-12-01 19:15:32,235 INFO [org.jboss.deployment.MainDeployer] Starting deployment of package: file:/opt/apps/jboss/jboss-3.2.2/server/idev1a/deploy/envcheck.ear
            2003-12-01 19:15:32,247 INFO [org.jboss.deployment.EARDeployer] Init J2EE application: file:/opt/apps/jboss/jboss-3.2.2/server/idev1a/deploy/envcheck.ear
            2003-12-01 19:15:32,734 INFO [org.jboss.web.catalina.EmbeddedCatalinaService41] deploy, ctxPath=/envcheck, warUrl=file:/opt/apps/jboss/jboss-3.2.2/server/idev1a/tmp/deploy/tmp43809envcheck.ear-contents/envcheck.war/
            2003-12-01 19:15:33,786 INFO [org.jboss.web.localhost.Engine] ContextConfig[/envcheck]: Added certificates -> request attribute 2003-12-01 19:15:14,498 INFO [org.jboss.mq.server.jmx.Queue.ex] Bound to JNDI name: queue/ex
            2003-12-01 19:15:14,500 INFO [org.jboss.mq.server.jmx.Queue.ex] Started jboss.mq.destination:service=Queue,name=ex
            2003-12-01 19:15:14,576 INFO [org.jboss.security.plugins.JaasSecurityManagerService] Created securityMgr=org.jboss.security.plug
            ins.JaasSecurityManager@1e3a0ec
            2003-12-01 19:15:14,582 INFO [org.jboss.security.plugins.JaasSecurityManagerService] setCachePolicy, c=org.jboss.util.TimedCache
            Policy@15a07bf
            2003-12-01 19:15:14,583 INFO [org.jboss.security.plugins.JaasSecurityManagerService] Added jbossmq, org.jboss.security.plugins.S
            ecurityDomainContext@1b2b131 to map
            2003-12-01 19:15:14,610 INFO [org.jboss.mq.security.SecurityManager] Started jboss.mq:service=SecurityManager
            2003-12-01 19:15:14,646 INFO [org.jboss.mq.server.jmx.Topic.testTopic] Bound to JNDI name: topic/testTopic
            2003-12-01 19:15:14,650 INFO [org.jboss.mq.server.jmx.Topic.testTopic] Started jboss.mq.destination:service=Topic,name=testTopic
            2003-12-01 19:15:14,654 INFO [org.jboss.mq.server.jmx.Topic.securedTopic] Bound to JNDI name: topic/securedTopic
            2003-12-01 19:15:14,656 INFO [org.jboss.mq.server.jmx.Topic.securedTopic] Started jboss.mq.destination:service=Topic,name=secure
            dTopic
            2003-12-01 19:15:14,662 INFO [org.jboss.mq.server.jmx.Topic.testDurableTopic] Bound to JNDI name: topic/testDurableTopic
            2003-12-01 19:15:14,665 INFO [org.jboss.mq.server.jmx.Topic.testDurableTopic] Started jboss.mq.destination:service=Topic,name=te
            stDurableTopic
            2003-12-01 19:15:14,678 INFO [org.jboss.mq.server.jmx.Queue.testQueue] Bound to JNDI name: queue/testQueue
            2003-12-01 19:15:14,681 INFO [org.jboss.mq.server.jmx.Queue.testQueue] Started jboss.mq.destination:service=Queue,name=testQueue
            2003-12-01 19:15:14,683 INFO [org.jboss.mq.server.jmx.InterceptorLoader] Started jboss.mq:service=TracingInterceptor
            2003-12-01 19:15:14,688 INFO [org.jboss.mq.server.jmx.Invoker] Started jboss.mq:service=Invoker
            2003-12-01 19:15:14,987 INFO [org.jboss.mq.il.http.HTTPServerILService] Started jboss.mq:service=InvocationLayer,type=HTTP
            2003-12-01 19:15:15,003 ERROR [org.jboss.mq.il.uil2.UILServerILService] Starting failed
            java.net.BindException: Address already in use
            at java.net.PlainSocketImpl.socketBind(Native Method)
            at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:331)
            at java.net.ServerSocket.bind(ServerSocket.java:318)
            at java.net.ServerSocket.(ServerSocket.java:185)
            at javax.net.DefaultServerSocketFactory.createServerSocket(DashoA6275)
            at org.jboss.mq.il.uil2.UILServerILService.startService(UILServerILService.java:177)
            at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
            at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:324)
            at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
            at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)
            at $Proxy14.start(Unknown Source)
            at org.jboss.system.ServiceController.start(ServiceController.java:394)



            • 3. Re: java.net.BindException:  Address already in use
              tgilley42 Newbie


              Jonlee, I didn't see the note you left above. Thanks for replying! That was exactly it.

              • 4. Re: java.net.BindException:  Address already in use
                Jon Barnett Master

                Have a look under your JBOSS_HOME/server/default/deploy/jms directory for all the Java Message Service (Message Queue) services.

                • 5. Re: java.net.BindException:  Address already in use
                  tgilley42 Newbie


                  Thanks again, you're a genius. I changed the ports in uil2-service.xml, oil2-service.xml and oil-service.xml (under deploy/jms), and now both of my server instances deploy successfully.

                  With much Gratitude,
                  tgilley42