Upgrading my server from 3.12 to 4.5

Sumit5 years ago

Hi Anton,
I have upgraded my system but I am getting this error. I have installed default-jdk and default-jre.

● traccar.service - traccar
   Loaded: loaded (/etc/systemd/system/traccar.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2019-06-03 16:54:33 IST; 4s ago
  Process: 13713 ExecStart=/opt/traccar/jre/bin/java -jar tracker-server.jar conf/traccar.xml (code=exited, status=1/FAILURE)
 Main PID: 13713 (code=exited, status=1/FAILURE)

Jun 03 16:54:33 ip-172-31-18-38 traccar[13713]:         at java.base/jdk.internal.util.xml.impl.Parser.qname(Parser.java:1776)
Jun 03 16:54:33 ip-172-31-18-38 traccar[13713]:         at java.base/jdk.internal.util.xml.impl.Parser.step(Parser.java:395)
Jun 03 16:54:33 ip-172-31-18-38 traccar[13713]:         at java.base/jdk.internal.util.xml.impl.ParserSAX.parse(ParserSAX.java:508)
Jun 03 16:54:33 ip-172-31-18-38 traccar[13713]:         at java.base/jdk.internal.util.xml.impl.ParserSAX.parse(ParserSAX.java:411)
Jun 03 16:54:33 ip-172-31-18-38 traccar[13713]:         at java.base/jdk.internal.util.xml.impl.ParserSAX.parse(ParserSAX.java:374)
Jun 03 16:54:33 ip-172-31-18-38 traccar[13713]:         at java.base/jdk.internal.util.xml.impl.SAXParserImpl.parse(SAXParserImpl.java:97)
Jun 03 16:54:33 ip-172-31-18-38 traccar[13713]:         at java.base/jdk.internal.util.xml.PropertiesDefaultHandler.load(PropertiesDefaultHandler.java:83)
Jun 03 16:54:33 ip-172-31-18-38 traccar[13713]:         ... 5 more
Jun 03 16:54:33 ip-172-31-18-38 systemd[1]: traccar.service: Main process exited, code=exited, status=1/FAILURE
Jun 03 16:54:33 ip-172-31-18-38 systemd[1]: traccar.service: Failed with result 'exit-code'.
Sumit5 years ago

And I tried this command also - java -jar tracker-server.log
It prints these following lines-

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/traccar/lib/slf4j-jdk14-1.7.26.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/traccar/lib/logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.JDK14LoggerFactory]
Exception in thread "main" java.lang.RuntimeException: Configuration file is not provided
        at org.traccar.Main.main(Main.java:79)
Anton Tananaev5 years ago

First error - your config is invalid.

Second error is pretty self-explanatory.

Sumit5 years ago

Thank you for the quick response. I try to reinstall the server.

Sumit5 years ago

Now, it is working.

Sumit5 years ago

Hi, I am using maven and I had added some code into DefaultDataHandler.java file to log the data. But when I start the traccar server after uploading new tracker-server.jar file on the server, I got this:

● traccar.service - traccar
   Loaded: loaded (/etc/systemd/system/traccar.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2019-06-05 16:18:23 IST; 10s ago
  Process: 8389 ExecStart=/opt/traccar/jre/bin/java -jar tracker-server.jar conf/traccar.xml (code=exited, status=1/FAILURE)
 Main PID: 8389 (code=exited, status=1/FAILURE)

Jun 05 16:18:23 ip-172-31-8-69 systemd[1]: Started traccar.
Jun 05 16:18:23 ip-172-31-8-69 traccar[8389]: Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
Jun 05 16:18:23 ip-172-31-8-69 traccar[8389]:         at org.traccar.Main.<clinit>(Main.java:35)
Jun 05 16:18:23 ip-172-31-8-69 traccar[8389]: Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
Jun 05 16:18:23 ip-172-31-8-69 traccar[8389]:         at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
Jun 05 16:18:23 ip-172-31-8-69 traccar[8389]:         at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
Jun 05 16:18:23 ip-172-31-8-69 traccar[8389]:         at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
Jun 05 16:18:23 ip-172-31-8-69 traccar[8389]:         ... 1 more
Jun 05 16:18:23 ip-172-31-8-69 systemd[1]: traccar.service: Main process exited, code=exited, status=1/FAILURE
Jun 05 16:18:23 ip-172-31-8-69 systemd[1]: traccar.service: Failed with result 'exit-code'.
Sumit5 years ago

And when I stepped down to its initial 4.5 build tracker-server.jar, then it is fine. And no error was occurred.

● traccar.service - traccar
   Loaded: loaded (/etc/systemd/system/traccar.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2019-06-05 17:12:52 IST; 3min 29s ago
 Main PID: 8509 (java)
    Tasks: 29 (limit: 2364)
   CGroup: /system.slice/traccar.service
           └─8509 /opt/traccar/jre/bin/java -jar tracker-server.jar conf/traccar.xml

Jun 05 17:12:53 ip-172-31-8-69 traccar[8509]: SLF4J: Found binding in [jar:file:/opt/traccar/lib/slf4j-jdk14-1.7.26.jar!/org/slf4j/impl/StaticLoggerBinder.class]
Jun 05 17:12:53 ip-172-31-8-69 traccar[8509]: SLF4J: Found binding in [jar:file:/opt/traccar/lib/logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
Jun 05 17:12:53 ip-172-31-8-69 traccar[8509]: SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
Jun 05 17:12:53 ip-172-31-8-69 traccar[8509]: SLF4J: Actual binding is of type [org.slf4j.impl.JDK14LoggerFactory]
Jun 05 17:12:53 ip-172-31-8-69 traccar[8509]: Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via t
Jun 05 17:13:04 ip-172-31-8-69 traccar[8509]: WARNING: An illegal reflective access operation has occurred
Jun 05 17:13:04 ip-172-31-8-69 traccar[8509]: WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/opt/traccar/lib/guice-4.2.2.jar) to method java.lang.Cla
Jun 05 17:13:04 ip-172-31-8-69 traccar[8509]: WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
Jun 05 17:13:04 ip-172-31-8-69 traccar[8509]: WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
Jun 05 17:13:04 ip-172-31-8-69 traccar[8509]: WARNING: All illegal access operations will be denied in a future release

```
Sumit5 years ago

Hello Anton,
I am badly stuck in this problem. I am unable to get rid of this slf4j problem.
I followed the steps from https://www.traccar.org/install-digitalocean/ and I am using 4.5 version.
I have done everything at intial level of 4.5, that is working fine. But when I try to upload only 4.5 version build from netbeans (containing no other of my custom code), it doesn't work. It gives me everytime these statements-

● traccar.service - traccar
   Loaded: loaded (/etc/systemd/system/traccar.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sat 2019-06-08 07:24:35 UTC; 1s ago
  Process: 18271 ExecStart=/opt/traccar/jre/bin/java -jar tracker-server.jar conf/traccar.xml (code=exited, status=1/FAILURE)
 Main PID: 18271 (code=exited, status=1/FAILURE)

Jun 08 07:24:35 ip-172-31-7-65 systemd[1]: Started traccar.
Jun 08 07:24:35 ip-172-31-7-65 traccar[18271]: Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
Jun 08 07:24:35 ip-172-31-7-65 traccar[18271]:         at org.traccar.Main.<clinit>(Main.java:35)
Jun 08 07:24:35 ip-172-31-7-65 traccar[18271]: Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
Jun 08 07:24:35 ip-172-31-7-65 traccar[18271]:         at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
Jun 08 07:24:35 ip-172-31-7-65 traccar[18271]:         at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
Jun 08 07:24:35 ip-172-31-7-65 traccar[18271]:         at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
Jun 08 07:24:35 ip-172-31-7-65 traccar[18271]:         ... 1 more
Jun 08 07:24:35 ip-172-31-7-65 systemd[1]: traccar.service: Main process exited, code=exited, status=1/FAILURE
Jun 08 07:24:35 ip-172-31-7-65 systemd[1]: traccar.service: Failed with result 'exit-code'.

I don't know how to solve and that 4.5 build is working on localhost:8082.

I have updated and upgraded the linux system also.
Please help me.

Sumit5 years ago

I have solved by installing the gradle from this link: https://linuxize.com/post/how-to-install-gradle-on-ubuntu-18-04/.

I think you should update the documentation for 4.5 version because some days ago, it was working well without any library installation.

Sumit5 years ago

Hi Anton,
I had done these steps:

  1. I had installed the version 3.12 from the Traccar Source installation link (https://www.traccar.org/install-digitalocean/).
  2. I added my phone to the remote server. And it worked fine without any error.
  3. Then I had downloaded the source code from Traccar GitHub Directory for 3.12 version.
  4. After that I created a new build jar file from the source code in NetBeans.
  5. I stopped the remote server and uploaded that new build to the remote server and started the server.
  6. It was also worked without occurring any error.
  7. After that I added my some custom code and do the same thing for the uploading process. And this time, it was worked also.

After that I moved to the Traccar 4.3 version. And I have gone through the same process as I had done for 3.12 version.
So It was also worked.

After that I want to migrate the server from 4.3 to 4.5. I have some issue, so I want to show you by following some steps.

  1. I had installed the version 4.5 from the Traccar Source installation link (https://www.traccar.org/install-digitalocean/).
  2. I added my phone to the remote server. And it worked fine without any error.
  3. Then I had downloaded the source code from Traccar GitHub Directory for 4.5 version.
  4. After that I created a new build jar file from the source code in NetBeans.
  5. I stopped the remote server and uploaded that new build to the remote server and started the server.
  6. It was getting an error which is described in https://www.traccar.org/forums/topic/upgrading-my-server-from-312-to-45/#post-43877.

So, I want to know if it is same process for installing 4.5 version as for up to 4.3 version.

Or I request you to please release a video tutorial for Traccar-4.5 as you had created for Traccar-3.16(https://youtu.be/rHLqDjQcCYY) if the 4.5 version has some minor changes.

Thanks