Exception NoClassDefFoundError: org/slf4j/LoggerFactory

Sumit5 years ago

Okay thanks.

Sumit5 years ago

I am got tired of this java.lang.ClassNotFoundException: org.slf4j.LoggerFactory error. I followed this link: https://www.traccar.org/install-digitalocean for Traccar-4.5 installation. Please provide me details in steps how to upload new build to the linux machine server. I am getting every time this error. Even I upload the same traccar-4.5 build without any changes.

I am not finding the proper solution even after new installation.

bzark5 years ago

If you download the installer from here https://www.traccar.org/download/ you will have no issues running v4.5.

If you need to build from source then use this link https://www.traccar.org/build/. But don't use Maven, use Gradle. It is very simple. All you need to install on the build server is a JDK of your choice. I use OpenJDK.

Sumit5 years ago

Thanks @bzark. Yes, I want to upload the build from the source code. Can you have look on this answer https://www.traccar.org/forums/topic/upgrading-my-server-from-312-to-45/#post-44045?
Can you write the steps for building the code for 4.5 as I have written in this answer?

bzark5 years ago

The build process couldn't be any easier thanks to Anton. I use AWS EC2 instance for traccar and my setup and build process is below.

JAVA
add-apt-repository ppa:linuxuprising/java
apt-get install oracle-java11-installer
traccar
git clone --recursive https://github.com/traccar/traccar.git --branch v4.5
cd traccar
./gradlew build
cp target/tracker-server.jar /opt/traccar/
Sumit5 years ago

Hi @bzark,
Thank you for the response. I tried what you have wrote. And after that I tried this - java -jar target/tracker-server.jar debug.xml.
It is saying jdbc.Driver not found.

bzark5 years ago

That isn't how you run traccar. You have to install traccar from the installer package and then use the start/stop scripts. The last step below copies the jar file you built from source code.

cp target/tracker-server.jar /opt/traccar/

Sumit5 years ago

So you are saying that I need to setup for oracle java, then I need to clone the Traccar-4.5 repository and build the gradle.
After this I can go for https://www.traccar.org/install-digitalocean/ and upload my new jar file and start the traccar service by using the systemctl start traccar.service.

bzark5 years ago

Yes.

Sumit5 years ago

Thanks.