Thanks for your help. I found out that actually those 3 xml files: ._Push.xml, ._host-manager.xml and ._manager.xml should not be there. There were there may be because an unexpected termination of tomcat. I deleted them and actually removed Push.xml as well and everything goes back to normal.
On Sat, May 15, 2010 at 2:21 AM, Pid <p...@pidster.com> wrote: > On 14/05/2010 22:44, Licht Jiang wrote: >> I run a servlet on tomcat 5.5.27, jvm 1.6.0_10-b33, and fedora >> 2.6.21.7-2.fc8xen. The service has a problem: after running for a >> certain time, the servlet becomes unavailable because of "too many >> open files" exception: >> >> 2010-05-13 23:58:14,575 DEBUG - Reload config... >> 2010-05-13 23:58:14,575 ERROR - java.io.FileNotFoundException: >> /root/Applications/tomcat-dev/webapps/MyServices/WEB-INF/classes/conf/MyConf.properties >> (Too many open files) >> >> To find out actually what files were opened too many times, I listed >> all of them and some of them are shown below: > > Shutdown Tomcat & check it has definitely stopped running. > > Please provide a complete directory listing for: > > /root/Applications/tomcat-dev/conf/Catalina/localhost > /root/Applications/tomcat-dev/webapps > > Please provide the contents of your server.xml, with all comments & any > passwords removed. > > Please post the code you are using in your servlet, to open & read > MyConf.properties. > > > p > > > >> ... >> java 11515 root 282r REG 8,1 197 182030 >> /root/Applications/tomcat-dev/conf/Catalina/localhost/._manager.xml >> java 11515 root 283r REG 8,1 197 182028 >> /root/Applications/tomcat-dev/conf/Catalina/localhost/._host-manager.xml >> java 11515 root 284r REG 8,1 197 182032 >> /root/Applications/tomcat-dev/conf/Catalina/localhost/._Push.xml >> java 11515 root 285r REG 8,1 197 182030 >> /root/Applications/tomcat-dev/conf/Catalina/localhost/._manager.xml >> java 11515 root 286r REG 8,1 197 182028 >> /root/Applications/tomcat-dev/conf/Catalina/localhost/._host-manager.xml >> java 11515 root 287r REG 8,1 197 182032 >> /root/Applications/tomcat-dev/conf/Catalina/localhost/._Push.xml >> java 11515 root 288r REG 8,1 197 182028 >> /root/Applications/tomcat-dev/conf/Catalina/localhost/._host-manager.xml >> java 11515 root 289r REG 8,1 197 182032 >> /root/Applications/tomcat-dev/conf/Catalina/localhost/._Push.xml >> java 11515 root 290r REG 8,1 197 182030 >> /root/Applications/tomcat-dev/conf/Catalina/localhost/._manager.xml >> java 11515 root 291r REG 8,1 197 182028 >> /root/Applications/tomcat-dev/conf/Catalina/localhost/._host-manager.xml >> java 11515 root 292r REG 8,1 197 182032 >> /root/Applications/tomcat-dev/conf/Catalina/localhost/._Push.xml >> ... >> >> where "java 11515" is tomcat. "MyConf.properties" does not appear on >> the above list. So, it is obvious the problem is due to those 3 xml >> files. Seems that tomcat keeps opening these 3 xml files until the >> limit is reached. >> >> So, my question is why tomcat keeps opening them and what is the >> trigger of the operation? For your reference, these 3 files are >> listed: >> >> _________Push.xml_______ >> >> <!-- The contents of this file will be loaded for each web application --> >> <Context> >> >> <!-- Default set of monitored resources --> >> <WatchedResource>WEB-INF/web.xml</WatchedResource> >> >> <!-- Uncomment this to disable session persistence across Tomcat >> restarts --> >> <Manager pathname="" /> >> >> <Resource name="jdbc/CEDB" auth="Container" type="javax.sql.DataSource" >> maxActive="20" maxIdle="30" maxWait="10000" >> username="username" password="secret" >> driverClassName="com.mysql.jdbc.Driver" >> url="jdbc:mysql://hostname:1234/ABCD?autoReconnect=true" >> validationQuery="select count(*) from Partner;" >> testOnReturn="true" testWhileIdle="true" >> removeAbandoned="true" logAbandoned="true" /> >> >> </Context> >> >> _________manager.xml_______ >> >> <?xml version="1.0" encoding="UTF-8"?> >> <!-- >> Licensed to the Apache Software Foundation (ASF) under one or more >> contributor license agreements. See the NOTICE file distributed with >> this work for additional information regarding copyright ownership. >> The ASF licenses this file to You under the Apache License, Version 2.0 >> (the "License"); you may not use this file except in compliance with >> the License. You may obtain a copy of the License at >> >> http://www.apache.org/licenses/LICENSE-2.0 >> >> Unless required by applicable law or agreed to in writing, software >> distributed under the License is distributed on an "AS IS" BASIS, >> WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. >> See the License for the specific language governing permissions and >> limitations under the License. >> --> >> <!-- >> >> Context configuration file for the Tomcat Manager Web App >> >> $Id: manager.xml 565211 2007-08-13 00:09:38Z markt $ >> >> --> >> >> >> <Context docBase="${catalina.home}/server/webapps/manager" >> privileged="true" antiResourceLocking="false" >> antiJARLocking="false"> >> >> <!-- Link to the user database we will get roles from --> >> <ResourceLink name="users" global="UserDatabase" >> type="org.apache.catalina.UserDatabase"/> >> >> </Context> >> >> _________host-manager.xml_______ >> >> <?xml version="1.0" encoding="UTF-8"?> >> <!-- >> Licensed to the Apache Software Foundation (ASF) under one or more >> contributor license agreements. See the NOTICE file distributed with >> this work for additional information regarding copyright ownership. >> The ASF licenses this file to You under the Apache License, Version 2.0 >> (the "License"); you may not use this file except in compliance with >> the License. You may obtain a copy of the License at >> >> http://www.apache.org/licenses/LICENSE-2.0 >> >> Unless required by applicable law or agreed to in writing, software >> distributed under the License is distributed on an "AS IS" BASIS, >> WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. >> See the License for the specific language governing permissions and >> limitations under the License. >> --> >> <!-- >> >> Context configuration file for the Tomcat Host Manager Web App >> >> $Id: host-manager.xml 565211 2007-08-13 00:09:38Z markt $ >> >> --> >> >> >> <Context docBase="${catalina.home}/server/webapps/host-manager" >> privileged="true" antiResourceLocking="false" >> antiJARLocking="false"> >> >> </Context> >> >> Any thoughts? >> >> Thanks! >> -Michael >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >> For additional commands, e-mail: users-h...@tomcat.apache.org >> > > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org