1 Reply Latest reply on Mar 20, 2003 7:37 AM by Adrian Brock

    JBoss 3 BindException to port 80

    Laurence Smith Newbie

      I am running JBoss 3 with the embedded Jetty on Linux RedHat version 8. I originally created a user ('jboss') specifically to run the JBoss server and have set Jetty to run on port 80 (by editing the service.xml file in the expanded war directory).

      Everything was running fine until I accidentally run the server as root. This changed all the tmp and log files owner and group to root. Then when I run as the jboss user the server refused to start.

      So, I deleted all the log files (server/log) and temporary files (server/tmp and /tmp/Jetty***) I think and managed to get the server to start.

      The problem now is that Jetty cannot bind to port 80. Giving the following error:

      15:44:52,525 INFO [MainDeployer] Deployed package: file:/usr/local/appServers/jboss-3.2.0RC1/server/magellan/deploy/http-invoker.sar/invoker.war/
      15:44:52,531 INFO [jbossweb] Starting Jetty/4.2.5
      15:44:52,679 INFO [jbossweb] Started org.mortbay.http.NCSARequestLog@a3d3b
      15:44:52,691 WARN [jbossweb] WARNING: Failed to start: SocketListener@0.0.0.0:80
      15:44:52,805 INFO [jbossweb] Started AJP13Listener on 0.0.0.0:8009
      15:44:52,812 INFO [jbossweb] NOTICE: AJP13 is not a secure protocol. Please protect the port 0.0.0.0:8009
      15:44:52,814 ERROR [JettyService] multiple exceptions...
      15:44:52,971 ERROR [JettyService] exception
      java.net.BindException: Permission denied
      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:176)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:197)
      at sun.reflect.GeneratedMethodAccessor8.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:549)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:957)
      at $Proxy11.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:388)
      at sun.reflect.GeneratedMethodAccessor7.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:549)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy5.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:299)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:824)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:636)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:600)
      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:549)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy7.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:404)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:545)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:195)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:268)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:197)
      at sun.reflect.GeneratedMethodAccessor8.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:549)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:957)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:388)
      at sun.reflect.GeneratedMethodAccessor7.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:549)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy5.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:299)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:824)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:636)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:600)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:584)
      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:549)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy6.deploy(Unknown Source)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:323)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:230)
      at org.jboss.Main.boot(Main.java:155)
      at org.jboss.Main$1.run(Main.java:393)
      at java.lang.Thread.run(Thread.java:536)
      15:44:53,145 INFO [JettyService] Started
      15:44:53,147 INFO [MainDeployer] Deployed package: file:/usr/local/appServers/jboss-3.2.0RC1/server/magellan/deploy/jbossweb.sar/
      15:44:53,153 INFO [MainDeployer] Starting deployment of package: file:/usr/local/appServers/jboss-3.2.0RC1/server/magellan/deploy/jmx-rmi-adaptor.sar/
      15:44:55,541 INFO [SARDeployer] looking for neste


      I have checked that no services are running on port 80 using nmap. Apache quite happily will start and stop and bind to port 80. I have also tried to start the server using two versions JBoss-3.0.6 and the one used above (3.2.0rc1). But to no avail. The only solution is to run the server as root which I believe is not the recommended way?

      Does anyone know if any temporary files are created when JBoss creates the socket? Whether this is the JVM or JBoss as this would explain why the jboss user cannot create the socket (because the temporary file was created by root).

      Any help much appreciated.

      Laurence