1. Error Log
2. How to add some command for Linux system
1. Error Log
I’m facing this kind problem when there are many Traccar client for androids has been keep sending the data to the server. It caused the Linux system to print this error log like below:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Exception in thread "pool-4-thread-1" java.lang.InternalError: java.io.FileNotFoundException: /usr/java/jdk1.8.0_60/jre/lib/ext/cldrdata.jar (Too many open files) | |
at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:1003) | |
at sun.misc.URLClassPath.getResource(URLClassPath.java:212) | |
at java.net.URLClassLoader$1.run(URLClassLoader.java:365) | |
at java.net.URLClassLoader$1.run(URLClassLoader.java:362) | |
at java.security.AccessController.doPrivileged(Native Method) | |
at java.net.URLClassLoader.findClass(URLClassLoader.java:361) | |
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) | |
at java.lang.ClassLoader.loadClass(ClassLoader.java:411) | |
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) | |
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) | |
at java.util.ResourceBundle$RBClassLoader.loadClass(ResourceBundle.java:503) | |
at java.util.ResourceBundle$Control.newBundle(ResourceBundle.java:2640) | |
at java.util.ResourceBundle.loadBundle(ResourceBundle.java:1501) | |
at java.util.ResourceBundle.findBundle(ResourceBundle.java:1465) | |
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1361) | |
at java.util.ResourceBundle.getBundle(ResourceBundle.java:845) | |
at java.util.logging.Level.computeLocalizedLevelName(Level.java:265) | |
at java.util.logging.Level.getLocalizedLevelName(Level.java:324) | |
at java.util.logging.SimpleFormatter.format(SimpleFormatter.java:165) | |
at java.util.logging.StreamHandler.publish(StreamHandler.java:211) | |
at java.util.logging.ConsoleHandler.publish(ConsoleHandler.java:116) | |
at java.util.logging.Logger.log(Logger.java:738) | |
at java.util.logging.Logger.doLog(Logger.java:765) | |
at java.util.logging.Logger.logp(Logger.java:1041) | |
at org.jboss.netty.logging.JdkLogger.warn(JdkLogger.java:80) | |
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:340) | |
at org.jboss.netty.channel.socket.nio.NioServerBoss.run(NioServerBoss.java:42) | |
at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108) | |
at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42) | |
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) | |
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) | |
at java.lang.Thread.run(Thread.java:745) | |
Caused by: java.io.FileNotFoundException: /usr/java/jdk1.8.0_60/jre/lib/ext/cldrdata.jar (Too many open files) | |
at java.util.zip.ZipFile.open(Native Method) | |
at java.util.zip.ZipFile.<init>(ZipFile.java:219) | |
at java.util.zip.ZipFile.<init>(ZipFile.java:149) | |
at java.util.jar.JarFile.<init>(JarFile.java:166) | |
at java.util.jar.JarFile.<init>(JarFile.java:103) | |
at sun.misc.URLClassPath$JarLoader.getJarFile(URLClassPath.java:893) | |
at sun.misc.URLClassPath$JarLoader.access$700(URLClassPath.java:756) | |
at sun.misc.URLClassPath$JarLoader$1.run(URLClassPath.java:838) | |
at sun.misc.URLClassPath$JarLoader$1.run(URLClassPath.java:831) | |
at java.security.AccessController.doPrivileged(Native Method) | |
at sun.misc.URLClassPath$JarLoader.ensureOpen(URLClassPath.java:830) | |
at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:1001) | |
... 31 more |
2. How to add some command for Linux system
In Traccar Server Web, I had configured some configurations but it still caused the same problem but after I read the document in Traccar’s Site I found the Solution.
In Traccar Server Web, I had configured some configurations but it still caused the same problem but after I read the document in Traccar’s Site I found the Solution.
By default Traccar runs from root user account as a daemon (service), so you have to check limits for the root user. On most systems by default, the limit is around 1024 connections.
To increase the limit add following lines to "/etc/security/limits.conf":
root soft nofile 50000
root hard nofile 50000
Make sure you use number higher than your number of devices because when device reconnects it might consume two or even more connection for some period of time.
You type these comment to check your default value, it so small:
Command for Hard Limit
ulimit -Hn
Command for Soft Limit
ulimit -Sn
Below is the output from my server, it is the default value so you have to change it in order avoid open file limit on your server.
Use this command: vi /etc/security/limits.conf to open the file and add these lines:
root soft nofile 50000
root hard nofile 50000
To check if it is effective or not, you have to log out from your remote and remote to it again and then type the old command :
ulimit -Hn
ulimit -Sn
result:
Hi,
ReplyDeleteThanks for sharing above info. Please how can it be done in windows installation. Assistance will be appreciated.
Many thanks.