From debug to Live

asiLab2 years ago

Hello,
I've completed my protocol implementation (Almost), I'm tring to publish from development to a published server.
I've generated with ./gradlew assemble a new tracker-server.jar and naturally edited the default.xml to add listening port.
When i try to restart traccar with new generated .jar i receive this error in syslog:

Jun 16 22:57:21 traccar systemd[1]: Started traccar.
Jun 16 22:57:22 traccar traccar[9556]: Exception in thread "main" java.lang.NoClassDefFoundError: com/google/inject/servlet/ServletModule
Jun 16 22:57:22 traccar traccar[9556]: #011at org.traccar.Main.run(Main.java:118)
Jun 16 22:57:22 traccar traccar[9556]: #011at org.traccar.Main.main(Main.java:112)
Jun 16 22:57:22 traccar traccar[9556]: Caused by: java.lang.ClassNotFoundException: com.google.inject.servlet.ServletModule
Jun 16 22:57:22 traccar traccar[9556]: #011at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
Jun 16 22:57:22 traccar traccar[9556]: #011at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
Jun 16 22:57:22 traccar traccar[9556]: #011at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
Jun 16 22:57:22 traccar traccar[9556]: #011... 2 more
Jun 16 22:57:22 traccar systemd[1]: traccar.service: Main process exited, code=exited, status=1/FAILURE
Jun 16 22:57:22 traccar systemd[1]: traccar.service: Failed with result 'exit-code'.
Jun 16 22:57:32 traccar systemd[1]: traccar.service: Service hold-off time over, scheduling restart.
Jun 16 22:57:32 traccar systemd[1]: traccar.service: Scheduled restart job, restart counter is at 11.

Any help appreciated.
Regards
Gian

Anton Tananaev2 years ago

It looks like you've based your changes on master instead of using tag matching the version of Traccar you have installed. I would recommend reapply your changes on top of the tag. If you want to use master, you need to update dependencies and potentially some other files as well.

asiLab2 years ago

Hum.. I suspected. I worked on master branch.....
I'm a little new with IntelliJ can you specify how to "reapply your changes on top of the tag".

thanks
gian

Anton Tananaev2 years ago

Are you using version control? It should help you with that.

asiLab2 years ago

Yes.. I get the project using git included in IntelliJ (open from repository)....
Do you suggest to pull everything again and keep just files i changed? My published version is 5.0.

g.

Anton Tananaev2 years ago

I think you need to study how to use git. You don't need to pull anything again. You need a different branch.

asiLab2 years ago

Ok, thanks for your help.
Gian.