2 Replies Latest reply on Jul 30, 2003 8:46 AM by William Wen

    socket errors

    William Wen Newbie

      I keep getting the error below when I try to bind to port 80. If I use a non-restricted port like 8080 then this error goes away. I tested this on various configurations (with jdk1.4.1):
      3.2.2 RC2
      and both with jetty and tomcat.

      What am I missing??

      00:22:50,680 WARN [jbossweb] WARNING: Connection problem
      java.net.SocketException: Invalid argument
      at java.net.PlainSocketImpl.socketSetOption(Native Method)
      at java.net.PlainSocketImpl.setOption(PlainSocketImpl.java:240)
      at java.net.Socket.setTcpNoDelay(Socket.java:753)
      at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:173)
      at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
      at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:454)

        • 1. Re: socket errors
          Jon Barnett Master

          What OS are you running on and are you using a privileged account to run JBoss? If this is a new problem - it didn't exist in a previous version, then I'm not sure of the issue.

          But if this is the first time you have run this on a Unix platform ... you cannot bind Tomcat/Jetty to a privileged port using a non-privileged account. This is a Unix security requirement. You can do the binding if you have a privileged account (root). However, there are also security issues involved in that, as someone could exploit a problem with the servlet container/JVM and cause the JVM to break in such a way that the hacker has access to the OS as the privileged account. There are no known problems at this time but most security people don't recommend it.

          With Linux there are ways around this, through the use of port redirection. With other Unices there will also be a means to address this.

          If you want to explore possible ways that Linux port redirection can work, you can access http://www.amitysolutions.com.au/downloads/Tomcat-Firewalls.pdf. It does assume some familiarity with Linux administration, iptables and networking. The solution is also applicable to Jetty as the main focus is on redirection of requests from port 80 to somewhere else. If you do use the documentation, let us know if you find any problems with it. Although we spent some time working through the scenarios and testing the configurations, there always will be some errors that creep in.

          I'm not sure if Windows XP has a problem with port 80 binding. Windows 2000 does not.

          • 2. Re: socket errors
            William Wen Newbie

            This is done on Solaris 2.8 on sparc. The user I used to run jboss has sudo access and the port is definitely bound properly, but the error just keeps coming up every two or three seconds.

            This is strange because I used the same setup with 3.0.4 and 3.0.6 and it works fine. I'll give port forwarding a shot.