6 Replies Latest reply on Apr 11, 2003 2:01 PM by yoyodyne

    ServiceBindingManager and Jetty

    Jason Agee Newbie

      I am in the process of getting 2 instances of JBoss running concurrently, but am having a problem with Jetty running two instances. I setup the ServiceBindingManager but always get the following error message:

      11:11:50,720 WARN [jbossweb] WARNING: Failed to start: SocketListener@0.0.0.0:8080
      11:11:50,720 WARN [jbossweb] WARNING: Failed to start: AJP13Listener@0.0.0.0:8009
      11:11:50,720 ERROR [JettyService] multiple exceptions...
      11:11:50,735 ERROR [JettyService] exception
      java.net.BindException: Address already in use: JVM_Bind
      at java.net.PlainSocketImpl.socketBind(Native Method)
      at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:331)
      .....(other stack info).

      I am pointing the ServiceBindingManager to the Sample-Bindings document in /JBossHome/docs/examples/binding-service. It doesn't seem that Jetty is picking up the new port numbers specified in the Sample-Bindings document. I see in the startup output that the other ports are getting the correct values for each instance of JBoss running, Jetty is the only one not recognizing the new ports. Has anyone experienced this? Thanks.

      Jason Agee

        • 1. Re: ServiceBindingManager and Jetty
          Jason Agee Newbie

          Here is a little more of the output:

          12:24:53,313 INFO [MainDeployer] Deployed package: file:/C:/JBoss/jboss-3.0.6/jboss-3.0.6/server/JBoss-Running/deploy/http-invoker.sar/
          12:24:53,313 INFO [MainDeployer] Starting deployment of package: file:/C:/JBoss/jboss-3.0.6/jboss-3.0.6/server/JBoss-Running/deploy/jbossweb.sar/
          12:24:54,048 INFO [jbossweb] Registered jboss.web:Jetty=0
          12:24:54,048 INFO [jbossweb] Registered jboss.web:Code=0
          12:24:54,063 INFO [jbossweb] Registered jboss.web:Log=0
          12:24:54,079 INFO [jbossweb] Registered jboss.web:Log=0,JBossLogSink=0
          12:24:54,095 INFO [JettyService] Creating
          12:24:54,345 INFO [jbossweb] Registered jboss.web:Jetty=0,SocketListener=0
          12:24:54,532 INFO [jbossweb] Registered jboss.web:Jetty=0,AJP13Listener=0
          12:24:54,579 INFO [jbossweb] Registered jboss.web:Jetty=0,NCSARequestLog=0
          12:24:54,641 INFO [JettyService] Created
          12:24:54,657 INFO [JettyService] Starting
          12:24:54,657 INFO [MainDeployer] Adding deployer: org.jboss.jetty.JettyService@1b34126
          12:24:54,657 INFO [MainDeployer] Starting deployment of package: file:/C:/JBoss/jboss-3.0.6/jboss-3.0.6/server/JBoss-Running/deploy/http-invoker.sar/invoker.war/
          12:24:54,782 INFO [Manager] cloning Manager: org.mortbay.j2ee.session.Manager@1f2cea2
          12:24:54,782 INFO [JBossWebApplicationContext] setDistributableSessionManager org.mortbay.j2ee.session.Manager@1dc0e7a
          12:24:54,954 INFO [jbossweb] Registered jboss.web:Jetty=0,JBossWebApplicationContext=0,context=/invoker
          12:24:54,985 INFO [jbossweb] Checking Resource aliases
          12:24:55,376 INFO [JaasSecurityManagerService] Created securityMgr=org.jboss.security.plugins.JaasSecurityManager@17a1767
          12:24:55,376 INFO [JaasSecurityManagerService] setCachePolicy, c=org.jboss.util.TimedCachePolicy@18622f3
          12:24:55,376 INFO [JaasSecurityManagerService] Added http-invoker, org.jboss.security.plugins.SecurityDomainContext@160877b to map
          12:24:55,391 INFO [jbossweb] Started WebApplicationContext[/invoker,file:/C:/JBoss/jboss-3.0.6/jboss-3.0.6/server/JBoss-Running/deploy/http-invoker.sar/invoker.war/]
          12:24:55,829 INFO [jbossweb] successfully deployed file:/C:/JBoss/jboss-3.0.6/jboss-3.0.6/server/JBoss-Running/deploy/http-invoker.sar/invoker.war/ to /invoker
          12:24:55,829 INFO [MainDeployer] Deployed package: file:/C:/JBoss/jboss-3.0.6/jboss-3.0.6/server/JBoss-Running/deploy/http-invoker.sar/invoker.war/
          12:24:55,829 INFO [jbossweb] Starting Jetty/4.2.6
          12:24:55,845 INFO [jbossweb] Started org.mortbay.http.NCSARequestLog@9505f
          12:24:55,845 WARN [jbossweb] WARNING: Failed to start: SocketListener@0.0.0.0:8080
          12:24:55,845 WARN [jbossweb] WARNING: Failed to start: AJP13Listener@0.0.0.0:8009
          12:24:55,845 ERROR [JettyService] multiple exceptions...
          12:24:55,860 ERROR [JettyService] exception
          java.net.BindException: Address already in use: JVM_Bind
          at java.net.PlainSocketImpl.socketBind(Native Method)
          at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:331)
          at java.net.ServerSocket.bind(ServerSocket.java:309)
          at java.net.ServerSocket.(ServerSocket.java:183)
          at org.mortbay.util.ThreadedServer.newServerSocket(ThreadedServer.java:317)
          at org.mortbay.util.ThreadedServer.start(ThreadedServer.java:389)
          at org.mortbay.http.SocketListener.start(SocketListener.java:154)
          at org.mortbay.http.HttpServer.start(HttpServer.java:654)
          at org.jboss.jetty.JettyService.startService(JettyService.java:182)
          at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:165)
          at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

          • 2. Re: ServiceBindingManager and Jetty
            yoyodyne Newbie

            yup, i have experienced this and it definitely seems to be a bug. i looked at ur post abt configuring individual files w/o using service binding. so what i have done is i have combined both approaches. for the jetty ports. i still explicitly make changes under jbossweb.sar.

            also, i had emailed u on bhabebaby@yahoo.com abt another problem which i cudnt get resolved on the forum. it wud be nice if u cud take a look at that.

            • 3. Re: ServiceBindingManager and Jetty
              qinding Newbie

              I use the ServiceBindingManager to config two servers (jboss0 and jboss1). I could only make one working but not the other. I followed the Service Binding Document and make the changes. I always got Adress already in use: JVM_Bind errors for many ports. Not just jetty.

              How do you make changes to use ServiceBindingManager? Please advise. Thank you.

              QD

              • 4. Re: ServiceBindingManager and Jetty
                yoyodyne Newbie

                can u post the exceptions thrown on ur console

                • 5. Re: ServiceBindingManager and Jetty
                  Jason Agee Newbie

                  I am not going to claim that I am 100% correct, because as this post indicates, I am having problems, but I will explain what I believe is a solution based on the responses to this forum, and ones in the past. First, I took a look at:
                  http://www.yorku.ca/dkha/jboss/docs/MultipleInstances.htm
                  Then I took a look at:
                  http://prdownloads.sourceforge.net/jboss/BindingService.pdf?download

                  It appears that combining these two approaches resolves any conflicts. I performed the following steps:

                  1.) go to the JBOSS_HOME\server directory.
                  2.) Make 2 copies of the default directory, and name them jboss0 and jboss1.
                  3.) Go to the new directory JBOSS_HOME\server\jboss0\conf and open the jboss-service.xml file. Here uncomment the portion that says:


                  /docs/examples/binding-service/sample-bindings.xml

                  org.jboss.services.binding.XMLServicesStoreFactory


                  4.) Go to the other new directory JBOSS_HOME\server\jboss1\conf and do the same thing.

                  5.) Go to the JBOSS_HOME\server\jboss1\deploy\jbossweb.sar\META-INF
                  directory and open the jboss-service.xml file
                  Next do the following (I am quoting from http://www.yorku.ca/dkha/jboss/docs/MultipleInstances.htm)
                  * Under the "Configure the Request Listeners" section, look for the add listener call of "org.mortbay.http.SocketListener" and change the port setting line to (8080 is the default):

                  * Under the "Configure the Request Listeners" section, look for the add listener call of "org.mortbay.http.ajp.AJP13Listener" and change the port setting line to (8009 is the default):
                  18009
                  Also the call "org.mortbay.http.ajp.AJP13Listener", change the port setting line to (443 is the default):
                  1443

                  6.) finally do the following:
                  JBOSS_HOME/bin/run.sh(or run.bat) -c jboss0
                  JBOSS_HOME/bin/run.sh(or run.bat) -c jboss1


                  Before I performed step 5.) I was receiving some errors from Jetty, and in response to yoyodyne here are the exceptions that I was getting.

                  12:24:54,985 INFO [jbossweb] Checking Resource aliases
                  12:24:55,376 INFO [JaasSecurityManagerService] Created securityMgr=org.jboss.security.plugins.JaasSecurityManager@17a1767
                  12:24:55,376 INFO [JaasSecurityManagerService] setCachePolicy, c=org.jboss.util.TimedCachePolicy@18622f3
                  12:24:55,376 INFO [JaasSecurityManagerService] Added http-invoker, org.jboss.security.plugins.SecurityDomainContext@160877b to map
                  12:24:55,391 INFO [jbossweb] Started WebApplicationContext[/invoker,file:/C:/JBoss/jboss-3.0.6/jboss-3.0.6/server/JBoss-Running/deploy/http-invoker.sar/invoker.war/]
                  12:24:55,829 INFO [jbossweb] successfully deployed file:/C:/JBoss/jboss-3.0.6/jboss-3.0.6/server/JBoss-Running/deploy/http-invoker.sar/invoker.war/ to /invoker
                  12:24:55,829 INFO [MainDeployer] Deployed package: file:/C:/JBoss/jboss-3.0.6/jboss-3.0.6/server/JBoss-Running/deploy/http-invoker.sar/invoker.war/
                  12:24:55,829 INFO [jbossweb] Starting Jetty/4.2.6
                  12:24:55,845 INFO [jbossweb] Started org.mortbay.http.NCSARequestLog@9505f
                  12:24:55,845 WARN [jbossweb] WARNING: Failed to start: SocketListener@0.0.0.0:8080
                  12:24:55,845 WARN [jbossweb] WARNING: Failed to start: AJP13Listener@0.0.0.0:8009
                  12:24:55,845 ERROR [JettyService] multiple exceptions...
                  12:24:55,860 ERROR [JettyService] exception
                  java.net.BindException: Address already in use: JVM_Bind
                  at java.net.PlainSocketImpl.socketBind(Native Method)
                  at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:331)
                  at java.net.ServerSocket.bind(ServerSocket.java:309)
                  at java.net.ServerSocket.(ServerSocket.java:183)
                  at org.mortbay.util.ThreadedServer.newServerSocket(ThreadedServer.java:317)
                  at org.mortbay.util.ThreadedServer.start(ThreadedServer.java:389)
                  at org.mortbay.http.SocketListener.start(SocketListener.java:154)
                  at org.mortbay.http.HttpServer.start(HttpServer.java:654)
                  at org.jboss.jetty.JettyService.startService(JettyService.java:182)
                  at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:165)
                  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:517)
                  at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:1003)
                  at $Proxy4.start(Unknown Source)
                  at org.jboss.system.ServiceController.start(ServiceController.java:413)
                  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:517)
                  at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
                  at $Proxy2.start(Unknown Source)
                  at org.jboss.deployment.SARDeployer.start(SARDeployer.java:230)
                  at org.jboss.deployment.MainDeployer.start(MainDeployer.java:814)
                  at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:627)
                  at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:591)
                  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:517)
                  at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
                  at $Proxy3.deploy(Unknown Source)
                  at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:435)
                  at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDeploymentScanner.java:656)
                  at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:507)
                  at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:261)
                  at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:165)
                  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:517)
                  at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:1003)
                  at $Proxy0.start(Unknown Source)
                  at org.jboss.system.ServiceController.start(ServiceController.java:413)
                  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:517)
                  at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
                  at $Proxy2.start(Unknown Source)
                  at org.jboss.deployment.SARDeployer.start(SARDeployer.java:230)
                  at org.jboss.deployment.MainDeployer.start(MainDeployer.java:814)
                  at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:627)
                  at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:591)
                  at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:575)
                  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:517)
                  at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:325)
                  at org.jboss.system.server.ServerImpl.start(ServerImpl.java:222)
                  at org.jboss.Main.boot(Main.java:148)
                  at org.jboss.Main$1.run(Main.java:381)
                  at java.lang.Thread.run(Thread.java:536)
                  12:24:55,860 ERROR [JettyService] exception
                  java.net.BindException: Address already in use: JVM_Bind
                  at java.net.PlainSocketImpl.socketBind(Native Method)
                  at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:331)
                  at java.net.ServerSocket.bind(ServerSocket.java:309)
                  at java.net.ServerSocket.(ServerSocket.java:183)
                  at org.mortbay.util.ThreadedServer.newServerSocket(ThreadedServer.java:317)
                  at org.mortbay.util.ThreadedServer.start(ThreadedServer.java:389)
                  at org.mortbay.http.ajp.AJP13Listener.start(AJP13Listener.java:128)
                  at org.mortbay.http.HttpServer.start(HttpServer.java:654)
                  at org.jboss.jetty.JettyService.startService(JettyService.java:182)
                  at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:165)
                  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:517)
                  at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:1003)
                  at $Proxy4.start(Unknown Source)
                  at org.jboss.system.ServiceController.start(ServiceController.java:413)
                  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:517)
                  at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
                  at $Proxy2.start(Unknown Source)
                  at org.jboss.deployment.SARDeployer.start(SARDeployer.java:230)
                  at org.jboss.deployment.MainDeployer.start(MainDeployer.java:814)
                  at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:627)
                  at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:591)
                  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:517)
                  at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
                  at $Proxy3.deploy(Unknown Source)
                  at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:435)
                  at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDeploymentScanner.java:656)
                  at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:507)
                  at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:261)
                  at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:165)
                  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:517)
                  at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:1003)
                  at $Proxy0.start(Unknown Source)
                  at org.jboss.system.ServiceController.start(ServiceController.java:413)
                  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:517)
                  at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
                  at $Proxy2.start(Unknown Source)
                  at org.jboss.deployment.SARDeployer.start(SARDeployer.java:230)
                  at org.jboss.deployment.MainDeployer.start(MainDeployer.java:814)
                  at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:627)
                  at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:591)
                  at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:575)
                  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:517)
                  at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:325)
                  at org.jboss.system.server.ServerImpl.start(ServerImpl.java:222)
                  at org.jboss.Main.boot(Main.java:148)
                  at org.jboss.Main$1.run(Main.java:381)
                  at java.lang.Thread.run(Thread.java:536)
                  12:24:55,876 INFO [JettyService] Started


                  Thanks, and good luck.

                  Jason Agee

                  • 6. Re: ServiceBindingManager and Jetty
                    yoyodyne Newbie

                    yup, i did exactly the same thing as u did. Plus in jboss-3.0.7, u also need to change the ports in jbossmq-service.xml file explicity for