You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by rouble <ro...@gmail.com> on 2009/01/20 06:39:26 UTC

axis2 bug? I/O exception: Too many open files

Hi All,

I wanted to stress test the my web service, so I coded up a quick client,
and put the method invocation in a loop:
            ServiceStub stub = new ServiceStub();

            for (int i=0; i<totalNotifications; i++) {
                stub.Notification(n);
                System.out.println("Sent Notify number " + i + ".");
            }

Now, after about 31515 successful invocations, I get:
- I/O exception (java.net.SocketException) caught when processing request:
Too many open files
- Retrying request
- I/O exception (java.net.SocketException) caught when processing request:
Too many open files
- Retrying request
- I/O exception (java.net.SocketException) caught when processing request:
Too many open files
- Retrying request
- Unable to sendViaPost to url[http://example.com/axis2/services/Service]
java.net.SocketException: Too many open files
        at java.net.Socket.createImpl(Socket.java:388)
        at java.net.Socket.getImpl(Socket.java:451)

Now I can't tell, if:
a) I have coded the client wrong
b) This is a garbage collection issue
c) Axis2 is not properly closing sockets

Any insight is appreciated.

Also, on a related note, how can I tell an Axis2 client to re-use an
existing connection/socket, instead of creating a new socket for every
transaction?

TIA,
rouble