Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

ClassNotFoundException

Daniel Gregoire edited this page Aug 30, 2015 · 2 revisions

To quote from the Java documentation, the ClassNotFoundException is:

Thrown when an application tries to load in a class through its string name using:

  • The forName method in class Class.
  • The findSystemClass method in class ClassLoader.
  • The loadClass method in class ClassLoader.

but no definition for the class with the specified name could be found.

For clj-webdriver, forgetting to specify the Selenium-WebDriver JAR's in your project.clj is the most likely cause of encountering this exception. If Clojure can't find a class that either your or a library's code tries to import, this exception will be thrown.

Depending on which namespace(s) in clj-webdriver you use, you may see a different Selenium-WebDriver class as the missing culprit at runtime, but the source of the problem is missing JAR's. For most use-cases, including [org.seleniumhq.selenium/selenium-java "x.y.z"] as a dependency will solve your problem, but take a look at the rest of this Wiki and Selenium-WebDriver's documentation for more details.