1 Reply Latest reply on Jul 16, 2004 11:45 AM by armieri

    JBoss/Jetty: Error Too many files open

    baqir

      Dear all,
      I have an application deployed on windows 2000 professional + Jboss 3.2.0 w Jetty. we are constantly receiving an Exception after every three four days which is:

      java.io.IOException: Too many open files
      at java.io.FileInputStream.open(Native Method)
      at java.io.FileInputStream.(FileInputStream.java:106)
      at org.mortbay.util.FileResource.getInputStream(FileResource.java:183)
      at org.mortbay.util.CachedResource.update(CachedResource.java:73)
      at org.mortbay.util.CachedResource.(CachedResource.java:37)
      at org.mortbay.util.Resource.cache(Resource.java:311)
      at org.mortbay.http.HttpContext.getResource(HttpContext.java:817)
      at org.mortbay.jetty.servlet.WebApplicationContext.getResource(WebApplic
      ationContext.java:1208)
      at org.mortbay.jetty.servlet.Default.getResource(Default.java:144)
      at org.mortbay.jetty.servlet.Default.service(Default.java:165)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:360
      )
      at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicati
      onHandler.java:294)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:5
      58)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1714)
      at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplication
      Context.java:507)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1664)
      at org.mortbay.http.HttpServer.service(HttpServer.java:863)
      at org.jboss.jetty.Jetty.service(Jetty.java:460)
      at org.mortbay.http.HttpConnection.service(HttpConnection.java:775)
      at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:939)
      at org.mortbay.http.HttpConnection.handle(HttpConnection.java:792)
      at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:
      201)
      at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
      at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:455)


      Whenever this exception occurs, the images stop displaying.

      Please suggest a solution for our problem.
      Thanks.

      Baqir

        • 1. Re: JBoss/Jetty: Error Too many files open
          armieri

          Probably the infamous JVM error, if files are not deleting then you are at least running 1.4.2. Heard a report that it may be fixed in 1.5, try it if you can and let me know.

          Otherwise, check for file leaks in you app. For instance, we are tuning our app to use a static properties file instance variable... otherwise every time the class is instantiated a new file handle is opened and stays around for the life of the class (which in our instance, was for the entire time the user session was active).

          FYI, since this is a JVM problem the same thing happens on all web servers... check out this link from BEA:

          http://support.bea.com/support_news/product_troubleshooting/Too_Many_Open_Files_Pattern.html