2

I have an application using AppFuse and mysql database

The problem is sometime the following exception is thrown :

Jan 27, 2011 4:54:56 AM org.apache.tomcat.util.net.PoolTcpEndpoint acceptSocket
SEVERE: Endpoint ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=8080] ignored exception: java.net.SocketException: Too many open files
java.net.SocketException: Too many open files
    at java.net.PlainSocketImpl.socketAccept(Native Method)
    at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
    at java.net.ServerSocket.implAccept(ServerSocket.java:453)
    at java.net.ServerSocket.accept(ServerSocket.java:421)
    at  org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(DefaultServerSocketFactory.java:60)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.acceptSocket(PoolTcpEndpoint.java:368)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:549)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
    at java.lang.Thread.run(Thread.java:619)

Jan 27, 2011 4:54:56 AM org.apache.tomcat.util.net.PoolTcpEndpoint acceptSocket.

Please could any one tell me the main reason for that exception? And if that exception can lead tomcat to be shutdown ?

Thanks in Advance

2
  • amitbhayani.blogspot.com/2010/01/… Commented Feb 6, 2011 at 8:52
  • Thanks a lot Nishant for your help. But if this exception can lead tomcat to be shutdown or not ?? Commented Feb 6, 2011 at 8:53

1 Answer 1

1

are you performing a bunch of sql statements against your db in a tight loop?

If so, make sure you do stmt.close() on each one.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks Joe , But is there an automated tool that can find the unclosed statements? Thanks in Advance
Not sure about that. Hopefully you can narrow the behavior to some region of code. Also, if your app separates data access classes into a central place, you can look there to see if it is releasing the resources.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.