Too many open files in tomcat catalina.err

Issues related to applications and software problems
Post Reply
golden3
Posts: 50
Joined: 2014/07/22 05:55:42

Too many open files in tomcat catalina.err

Post by golden3 » 2017/03/28 06:09:41

I have an application running on tomcat and sometimes in centos 6.8 & I have the error below facing .

Mar 28, 2017 10:46:27 AM org.apache.catalina.core.ApplicationContext log
SEVERE: Failed to locate resource [/WEB-INF/web.xml] in context []
java.io.FileNotFoundException: /home/user123/public_html/WEB-INF/web.xml (Too many open files)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:146)
at org.apache.naming.resources.FileDirContext$FileResource.streamContent(FileDirContext.java:900)
at org.apache.catalina.core.ApplicationContext.getResourceAsStream(ApplicationContext.java:581)
at org.apache.catalina.core.ApplicationContextFacade.getResourceAsStream(ApplicationContextFacade.java:212)
at org.apache.catalina.startup.ContextConfig.getContextWebXmlSource(ContextConfig.java:1782)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1251)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:376)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5322)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3954)
at org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:426)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1345)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1530)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1540)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1540)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1519)
at java.lang.Thread.run(Thread.java:745)

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Too many open files in tomcat catalina.err

Post by TrevorH » 2017/03/28 08:42:44

Use limits.conf (or a file in limits.d) to adjust the limit.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: Too many open files in tomcat catalina.err

Post by aks » 2017/03/29 17:08:40

... of the user that tomcat runs as.

golden3
Posts: 50
Joined: 2014/07/22 05:55:42

Re: Too many open files in tomcat catalina.err

Post by golden3 » 2017/03/30 05:31:15

@TrevorH

ulimit adjustment is universal , If we change it might be affect server performance, so my question 'ulimit' is a only solution to avoid the issue either any dependency of API related issue (Apache / Tomcat) .Also it was running tomcat on it .

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Too many open files in tomcat catalina.err

Post by TrevorH » 2017/03/30 06:16:03

ulimit is done by user and/or group.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

golden3
Posts: 50
Joined: 2014/07/22 05:55:42

Re: Too many open files in tomcat catalina.err

Post by golden3 » 2017/04/03 07:40:54

@TrevorH So you are recommending to increase an ulimit ? right

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Too many open files in tomcat catalina.err

Post by TrevorH » 2017/04/03 12:49:32

If you are hitting the number of open files limit then your only alternatives are to amend your config so that it opens less files or to increase the limit.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply