We have an application that does robotic web extraction, its built in a servlet web container, and all the HTTP extraction is done using HTTPClient 3.1 code. When deployed on resin 3.0, all is fine, has been stable for years. Now we are releasing a new version on Jboss 4.2.3, and we find that the JVM frequently throws connection timed out exceptions (instantly, not waiting for socket connect timeout of 10 seconds) as if sockets are not available to the JVM for HTTPUrlConnection calls. This bug happens intermittently, usually when the system is inactive, as if there were a pool of sockets, that is too small and it has to expand in capacity. We have configured ulimit, socket buffers etc correctly and are deployed on the same HTTPClient libraries and JVM version (and hardware) as the fully functional Resin version. What could be causing this behavior, perhaps does JBOSS manage a connection pool for sockets or HTTP connection for general usage by code executed within the web container?