Skip to content
Advertisement

java.lang.ClassNotFoundException: org.eclipse.jetty.Server

I am trying to run a maven project when I run mvn install everything is ok I got build success qnd when I tried to lunch the project I got the following exception:

JavaScript

and when I run mvn dependency:tree I got the following results:

JavaScript

and this is my pom.xml file :

JavaScript

JavaScript

so any idea how to fix this problem !!!!

Advertisement

Answer

Your dependency:tree has an ancient version of Jetty.

JavaScript

That’s not going to work.

You’ll need to fix net.es.oscars:utils:jar to not use that ancient, long since EOL (End of Life) version of Jetty.

Your pom.xml has a reference to an unstable milestone release

JavaScript

(The M0 section in the version means “Milestone 0”)

Use a stable release version of Jetty.

Look at https://www.eclipse.org/jetty/download.html to see what’s stable (milestone releases are never listed there)

Also look at https://github.com/eclipse/jetty.project/releases

Also see the Jetty Documentation for the overall list of major jetty versions. https://www.eclipse.org/jetty/documentation/current/what-jetty-version.html

As of the time of this answer, the latest stable release version is 9.4.18.v20190429

As for the java.lang.ClassNotFoundException, you’ll need to fix your dependencies first. If the problem still persists after fixing your dependencies, consider posting how you create your classloaders, their hierarchy, and how you use XmlConfiguration (and from which classloader).

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement