0

I am investigating the jsprit library. For this I just created a new project in Eclipse and copied-pasted the demo example class. Then I added all jars to the path, including log4j-1.2.17.jar. Nevrtheless I cannot execute the demo code due to the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/logging/log4j/LogManager
    at jsprit.core.problem.vehicle.VehicleImpl$Builder.<clinit>(VehicleImpl.java:108)
    at com.test.jsprit.main(jsprit.java:49)
Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.LogManager
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 2 more

What does it actually mean and how to solve this issue? Does it mean that some other *.jar file is missed?

UPDATE:

The error occurs at the following line:

Builder vehicleBuilder = VehicleImpl.Builder.newInstance("vehicle");
Klausos Klausos
  • 15,308
  • 51
  • 135
  • 217

2 Answers2

1

You are using the wrong version of the log4j lib. You need the 2.x version.

See:

LogManager (Version 1.x)

LogManager (Version 2.x)

Tiago Engel
  • 3,533
  • 1
  • 17
  • 22
0

log4j-1.2.17.jar implements log4j version 1 and its pretty old. What you need is implementation of log4j 2 - add this as the dependency: link

xersiee
  • 4,432
  • 1
  • 14
  • 23