日期:2014-05-17  浏览次数:20863 次

求助 tomcat 打开文件太多
帮忙看下,特急~~谢谢
Java code

\u4e25\u91cd: Servlet.service() for servlet default threw exception
java.io.FileNotFoundException: /home/an/tomcat/webapps/ROOT/Site/flash/xxdll.flv (Too many open files)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:106)
    at org.apache.naming.resources.FileDirContext$FileResource.streamContent(FileDirContext.java:927)
    at org.apache.catalina.servlets.DefaultServlet.copy(DefaultServlet.java:1832)
    at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:919)
    at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:398)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
    at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
    at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
    at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:381)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:889)
    at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:732)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:2262)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
2011-12-8 0:00:01 org.apache.catalina.core.StandardWrapperValve invoke




------解决方案--------------------
java.io.FileNotFoundException:
文件没找到 路径不对?
------解决方案--------------------
找不到文件 
你保存的文件最好不要全部集中在一起,最好有个分类!
------解决方案--------------------
引用
打开文件数过多。。。以前在linux部署项目遇到过。。。我当时的原因是因为没有将项目class达成jar包,直接打的war包。。。

我的改进方案: 将项目的所有class类打包为一个jar包,导入到本项目lib目录,,打成war包。。发布。。

你的