While testing Magnolia CMS 4.0 RC4 on my Ubuntu Linux, I’ve encounter this error in catalina.out
java.io.FileNotFoundException: /home/matteo/software/magnolia/magnolia-enterprise-4.0-rc4/apache-tomcat-5.5.27/webapps/magnoliaAuthor/repositories/magnolia/workspaces/config/db/seg0/cd1.dat (Too many open files)
Magnolia, by default, uses Derby database, a filesystem based ones, which opens a large amount of files.
I’ve solved this issue changing file limit by editing /etc/sysctl.conf and set fs.file-max to 400000 AND setting this line
tomcatservice hard nofile 5000
in /etc/security/limits.conf. I needed to restart the session and everything works fine!