If you experience this trying to access Web services deployed on a Glassfish3 server, you might want to tune your http-thread-pool settings. That fixed SocketExceptions we had when many concurrent threads was calling the web service.
- Go to admin console
- Navigate to "Configurations"->"Server config"->"Thread pools"->"http-thread-pool".
- Change setting "Max Thread Pool Size" from 5 to 32
- Change setting "Min Thread Pool Size" from 2 to 16
- Restart Glassfish.