The class could not be found

java.lang.ClassNotFoundException
Javadoc
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.

As of release 1.4, this exception has been retrofitted to conform to the general purpose exception-chaining mechanism. The "optional exception that was raised while loading the class" that may be provided at construction time and accessed via the {@link #getException()} method is now known as the cause, and may be accessed via the {@link Throwable#getCause()} method, as well as the aforementioned "legacy method." @author unascribed @see java.lang.Class#forName(java.lang.String) @see java.lang.ClassLoader#findSystemClass(java.lang.String) @see java.lang.ClassLoader#loadClass(java.lang.String, boolean) @since JDK1.0

at java.net.URLClassLoader.findClass
(source)

Typical Exception Messages

  1. org.slf4j.LoggerFactory
  2. org.hibernate.query.ParameterMetadata
  3. com.mysql.jdbc.Driver
  4. FlinkPipelineRunner
  5. org.apache.commons.logging.LogFactory
  6. org.codehaus.janino.ScriptEvaluator
  7. org.w3c.dom.ElementTraversal
  8. weka.attributeSelection.InfoGainAttributeEval
  9. org.springframework.boot.SpringApplication
  10. javax.servlet.ServletContext

Specific cases

Solution

poroszd, 1 month ago

This error pattern looks similar to error pattern 88439.

However, in this case, we are sure that this happens when sun.misc.URLClassPath.getResource(String name, boolean check) returns null. Practically every exception that happens in getResource is handled by returning null.

External results for this pattern (6304)

  1. io.micrometer.core.instrument.binder.hystrix.HystrixMetricsBinder
    Show stack trace
  2. org.apache.hadoop.hbase.MasterNotRunningException
    Show stack trace
  3. Sanhita bsvia Google Groups2 days ago
    org.slf4j.LoggerFactory
    Show stack trace
  4. vibhory2jvia GitHub2 days ago
    org.apache.thrift.scheme.StandardScheme
    Show stack trace
  5. org.python.modules._weakref.ReferenceBackendFactory
    Show stack trace
  6. Emilyvia Stack Overflow2 days ago
    javax.websocket.DeploymentException
    Show stack trace
  7. dseguyvia GitHub2 days ago
    com.lambdazen.bitsy.jsr223.BitsyGremlinPlugin
    Show stack trace
  8. adam-aroldvia GitHub2 days ago
    com.example.Playground.NestedOne
    Show stack trace