Hello everybody, I tried to start Traccar from VSCode.
I followed this guide: https://www.traccar.org/build/ .
For first, I cloned the official repository ( git clone --recursive https://github.com/traccar/traccar.git
). Then, I've done ./gradlew assemble
to generete tracker-server.jar
and then I moved to the target directory. In this directory, I've tried different command. The correct one I think is:
java -jar tracker-server.jar ../setup/default.xml
providing the path to default.xml
, but I obtain this error:
Exception in thread "main" java.lang.RuntimeException: java.io.FileNotFoundException: ./logs/tracker-server.log (No such file or directory)
at org.traccar.helper.Log$RollingFileHandler.publish(Log.java:83)
at java.logging/java.util.logging.Logger.log(Logger.java:979)
at org.slf4j.jul.JDK14LoggerAdapter.innerNormalizedLoggingCallHandler(JDK14LoggerAdapter.java:156)
at org.slf4j.jul.JDK14LoggerAdapter.handleNormalizedLoggingCall(JDK14LoggerAdapter.java:140)
at org.slf4j.helpers.AbstractLogger.handle_0ArgsCall(AbstractLogger.java:382)
at org.slf4j.helpers.AbstractLogger.error(AbstractLogger.java:347)
at org.traccar.Main.run(Main.java:146)
at org.traccar.Main.main(Main.java:106)
Caused by: java.io.FileNotFoundException: ./logs/tracker-server.log (No such file or directory)
at java.base/java.io.FileOutputStream.open0(Native Method)
at java.base/java.io.FileOutputStream.open(FileOutputStream.java:298)
at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:237)
at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:158)
at org.traccar.helper.Log$RollingFileHandler.publish(Log.java:77)
... 7 more
If I try to do:
java -jar tracker-server.jar ../setup/traccar.xml
I obtain:
2022-04-11 10:04:50 ERROR: Main method error - ./conf/default.xml (No such file or directory) - FileNotFoundException (... < Config:44 < Context:281 < Main:120 < ...)
Exception in thread "main" java.lang.RuntimeException: java.io.FileNotFoundException: ./conf/default.xml (No such file or directory)
at org.traccar.Main.run(Main.java:147)
at org.traccar.Main.main(Main.java:106)
Caused by: java.io.FileNotFoundException: ./conf/default.xml (No such file or directory)
at java.base/java.io.FileInputStream.open0(Native Method)
at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:112)
at org.traccar.config.Config.<init>(Config.java:44)
at org.traccar.Context.init(Context.java:281)
at org.traccar.Main.run(Main.java:120)
... 1 more
What am I doing wrong? Thank you for your precious help!
P.S. If I try:
java -jar tracker-server.jar conf/traccar.xml
2022-04-11 10:10:18 ERROR: Main method error - conf/traccar.xml (No such file or directory) - FileNotFoundException (... < Config:38 < Context:281 < Main:120 < ...)
Exception in thread "main" java.lang.RuntimeException: java.io.FileNotFoundException: conf/traccar.xml (No such file or directory)
at org.traccar.Main.run(Main.java:147)
at org.traccar.Main.main(Main.java:106)
Caused by: java.io.FileNotFoundException: conf/traccar.xml (No such file or
directory)
at java.base/java.io.FileInputStream.open0(Native Method)
at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:112)
at org.traccar.config.Config.<init>(Config.java:38)
at org.traccar.Context.init(Context.java:281)
at org.traccar.Main.run(Main.java:120)
... 1 more
The error message is pretty clear.
I created the folder conf and put the file traccar.xml inside it.
Now I've done:
java -jar tracker-server.jar conf/traccar.xml
and I obtained this error:
Error: Unable to initialize main class org.traccar.Main
Caused by: java.lang.NoClassDefFoundError: com/google/inject/Injector
I've not modified anything in the code
Looks like you're missing dependencies.
how to fix this problem? what should I install? Should I modify something?
I'm not sure why it happened. Gradle should automatically pick up dependencies.
Hello everybody, I tried to start Traccar from VSCode.
I followed this guide: https://www.traccar.org/build/ .
For first, I cloned the official repository (
git clone --recursive https://github.com/traccar/traccar.git
). Then, I've done./gradlew assemble
to generetetracker-server.jar
and then I moved to the target directory. In this directory, I've tried different command. The correct one I think is:java -jar tracker-server.jar ../setup/default.xml
providing the path to
default.xml
, but I obtain this error:If I try to do:
I obtain:
What am I doing wrong? Thank you for your precious help!
P.S. If I try:
java -jar tracker-server.jar conf/traccar.xml