On 25.05.2010 11:54, André Warnier wrote:
pri...@samea.de wrote:
Hello,
I have a problem with my little CORBA-Servlet.
Allways I get this error:
java.net.SocketException: Too many open files
sun.nio.ch.Net.socket0(Native Method)
sun.nio.ch.Net.socket(Net.java:97)
sun.nio.ch.SocketChannelImpl.<init>(SocketChannelImpl.java:84)
sun.nio.ch.SelectorProviderImpl.openSocketChannel(SelectorProviderImpl.java:37)
java.nio.channels.SocketChannel.open(SocketChannel.java:105)
java.nio.channels.SocketChannel.open(SocketChannel.java:145)
com.sun.corba.se.impl.transport.DefaultSocketFactoryImpl.createSocket(DefaultSocketFactoryImpl.java:60)
com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:188)
com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:218)
com.sun.corba.se.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:101)
com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:152)
com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:118)
com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:211)
org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
I use: Tomcat 6.0.26 on Linux JVM: 1.6.0_20-b02
At first sight, it doesn't look as if this is a Tomcat issue. It seems
more of an issue within your servlet.
Is this servlet opening its own connection to something else?
If yes, then you probably forget to close this connection when you are
done with it, and they accumulate until the OS tells your process that
it has too many open sockets at the same time.
Doing a "netstat -an" would probably provide more information.
If you are under Unix/Linux, you can also try "lsof", but only studying
the options is already quite a challenge.
On Linux you can get the most important file descriptor info also by
looking at the proc filesystem. If your process has process id (PID)
XYZ, then do:
ls -l /proc/XYZ/fd
It will list all open file descriptors, so you can find out, why there
are so many open ones (are they files, sockets, ...). If they are
sockets, you can list the association betweeb the sockets and the PID
(=XYZ) using
netstat -anp
Finally if you think you will need only a bit more descriptors, then
have a look at the "ulimit" command (man ulimit). There are hard and
soft limits. You can look at the active limits with "ulimit -a" and
"ulimit -H -a". The one you are interested in is "open files". You might
be able to set another limit with "ulimit -n".
Regards,
Rainer
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org